1DB_DEADLOCK(1) BerkeleyDB Utilities DB_DEADLOCK(1)
2
3
4
6 db_deadlock - Detect deadlocks and abort lock requests
7
9 db_deadlock [-Vv] [-a e | m | n | o | W | w | y ] [-h home] [-L file]
10 [-t sec.usec]
11
13 The db_deadlock utility traverses the database environment lock region,
14 and aborts a lock request each time it detects a deadlock or a lock
15 request that has timed out. By default, in the case of a deadlock, a
16 random lock request is chosen to be aborted.
17
18 This utility should be run as a background daemon, or the underlying
19 Berkeley DB deadlock detection interfaces should be called in some
20 other way, whenever there are multiple threads or processes accessing a
21 database and at least one of them is modifying it.
22
24 -a When a deadlock is detected, abort the locker:
25
26 m with the most locks
27
28 n with the fewest locks
29
30 o with the oldest lock
31
32 W with the most write locks
33
34 w with the fewest write locks
35
36 y with the youngest lock
37
38 When lock or transaction timeouts have been specified:
39
40 e abort any lock request that has timed out
41
42 -h home
43 Specify a home directory for the database environment; by
44 default, the current working directory is used.
45
46 -L file
47 Log the execution of the db_deadlock utility to the specified
48 file in the following format, where ### is the process ID, and
49 the date is the time the utility was started.
50
51 db_deadlock: ### Wed Jun 15 01:23:45 EDT 1995
52
53 This file will be removed if the db_deadlock utility exits
54 gracefully.
55
56 -t sec.usec
57 Check the database environment every sec seconds plus usec
58 microseconds to see if a process has been forced to wait for a
59 lock; if one has, review the database environment lock struc‐
60 tures.
61
62 -V Write the library version number to the standard output, and
63 exit.
64
65 -v Run in verbose mode, generating messages each time the detector
66 runs.
67
68 If the -t option is not specified, db_deadlock will run once and exit.
69
70 The db_deadlock utility uses a Berkeley DB environment (as described
71 for the -h option, the environment variable DB_HOME, or because the
72 utility was run in a directory containing a Berkeley DB environment).
73 In order to avoid environment corruption when using a Berkeley DB envi‐
74 ronment, db_deadlock should always be given the chance to detach from
75 the environment and exit gracefully. To cause db_deadlock to release
76 all environment resources and exit cleanly, send it an interrupt signal
77 (SIGINT).
78
79 The db_deadlock utility does not attempt to create the Berkeley DB
80 shared memory regions if they do not already exist. The application
81 which creates the region should be started first, and then, once the
82 region is created, the db_deadlock utility should be started.
83
84 The DB_ENV->lock_detect method is the underlying method used by the
85 db_deadlock utility. See the db_deadlock utility source code for an
86 example of using DB_ENV->lock_detect in a IEEE/ANSI Std 1003.1 (POSIX)
87 environment.
88
90 The db_deadlock utility exits 0 on success, and >0 if an error occurs.
91
93 DB_HOME
94 If the -h option is not specified and the environment variable
95 DB_HOME is set, it is used as the path of the database home, as
96 described in DB_ENV->open.
97
99 db_archive(1) db_checkpoint(1) db_dump(1) db_hotbackup(1) db_log_ver‐
100 ify(1) db_load(1) db_printlog(1) db_recover(1) db_replicate(1)
101 db_stat(1) db_tuner(1) db_upgrade(1) db_verify(1)
102
103
104
105BerkeleyDB 5.3.28 06 December 2016 DB_DEADLOCK(1)