File: db_deadlock.html

package info (click to toggle)
db 2%3A2.4.14-2.7.7.1.c
  • links: PTS
  • area: main
  • in suites: potato
  • size: 12,716 kB
  • ctags: 9,382
  • sloc: ansic: 35,556; tcl: 8,564; cpp: 4,890; sh: 2,075; makefile: 1,723; java: 1,632; sed: 419; awk: 153; asm: 41
file content (85 lines) | stat: -rw-r--r-- 3,554 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<! "@(#)db_deadlock.so	10.10 (Sleepycat) 12/11/98">
<!Copyright 1997, 1998 by Sleepycat Software, Inc.  All rights reserved.>
<html>
<body bgcolor=white>
<head>
<title>Berkeley DB: db_deadlock</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btr
ee,hash,hashing,transaction,transactions,locking,logging,access method,access me
thods,java,C,C++">
</head>
<h1>db_deadlock</h1>
<hr size=1 noshade>
<tt>
<h3>
<pre>
db_deadlock [<b>-vw</b>]
    [<b>-a m | o | y</b>] [<b>-h home</b>] [<b>-L file</b>] [<b>-t sec</b>]
</pre>
</h3>
<h1>Description</h1>
<p>
The db_deadlock utility traverses the database lock structures and
aborts a transaction each time it detects a deadlock.
This utility should be run as a background daemon whenever multiple threads
or processes are using locking.
By default, a random transaction involved in the deadlock is aborted.
<p>
The options are as follows:
<dl compact>
<p><dt><b>-a</b><dd>When a deadlock is detected,
abort the oldest (o) transaction, the youngest (y) transaction, or the
transaction with the minimum number of locks (m).
<p><dt><b>-h</b><dd>Specify a home directory for the database.
<p><dt><b>-L</b><dd>
Log the execution of the db_deadlock utility to the specified file in the
following format, where <i>###</i> is the process ID, and the date
is the time the utility starting running.
<p><ul><pre>db_deadlock: ### Wed Jun 15 01:23:45 EDT 1995</pre></ul><p>
This file will be removed if the db_deadlock utility exits gracefully.
<p><dt><b>-t</b><dd>Initiate a pass over the database locks at least every <b>sec</b> seconds.
<p><dt><b>-v</b><dd>Run in verbose mode, generating messages each time the detector runs.
<p><dt><b>-w</b><dd>Make a single pass over the database locks every time a process is forced
to wait for a lock.
</dl>
<p>
At least one of the <b>-t</b> and <b>-w</b> options must be specified.
<p>
The db_deadlock utility attaches to one or more of the Berkeley DB shared memory
regions.  In order to avoid region corruption, it should always be given
the chance to detach and exit gracefully.  To cause db_deadlock to clean up
after itself and exit, send it an interrupt signal (SIGINT).
<p>
The db_deadlock utility does not attempt to create the Berkeley DB
shared memory regions if they do not already exist.  The application
which creates the region should be started first, and then, once the
region is created, the db_deadlock utility should be started.
<p>
The <a href="../api_c/DbLockTab/detect.html">lock_detect</a> function is the underlying function used by the db_deadlock utility.
See the db_deadlock utility source code for an example of using <a href="../api_c/DbLockTab/detect.html">lock_detect</a>
in a POSIX 1003.1 environment.
<p>
The db_deadlock utility exits 0 on success, and >0 if an error occurs.
<p>
<h1>Environment Variables</h1>
<p>
<dl compact>
<p><dt>DB_HOME<dd>
If the <b>-h</b> option is not specified and the environment variable
DB_HOME is set, it is used as the path of the database home, as described
in <a href="../api_c/DbEnv/appinit.html">db_appinit</a>.
</dl>
<p>
<h1>See Also</h1>
<a href="../utility/db_archive.html">db_archive</a>,
<a href="../utility/db_checkpoint.html">db_checkpoint</a>,
db_deadlock,
<a href="../utility/db_dump.html">db_dump</a>,
<a href="../utility/db_load.html">db_load</a>,
<a href="../utility/db_recover.html">db_recover</a>,
and
<a href="../utility/db_stat.html">db_stat</a>.
</tt>
</body>
</html>