2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: db_stat</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
18
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
<h3><pre>db_stat <b>-d</b> <b>file</b> [<b>-fN</b>] [<b>-h home</b>] [<b>-P password</b>] [<b>-s database</b>]
23
db_stat [<b>-celmNrtVZ</b>] [<b>-C Aclmop</b>] [<b>-h home</b>] [<b>-M Ahm</b>] [<b>-P password</b>]</pre></h3>
25
<a name="3"><!--meow--></a>
26
<p>The db_stat utility displays statistics for Berkeley DB environments.
27
<p>The options are as follows:
29
<p><dt><b>-C</b><dd>Display internal information about the lock region. (The output from this
30
option is often both voluminous and meaningless, and is intended only for
33
<p><dt>A<dd>Display all information.
34
<dt>c<dd>Display lock conflict matrix.
35
<dt>l<dd>Display lockers within hash chains.
36
<dt>m<dd>Display region memory information.
37
<dt>o<dd>Display objects within hash chains.
38
<dt>p<dd>Display lock region parameters.
40
<p><dt><b>-c</b><dd>Display lock region statistics, as described in <a href="../api_c/lock_stat.html">DB_ENV->lock_stat</a>.
41
<p><dt><b>-d</b><dd>Display database statistics for the specified file, as described in
42
<a href="../api_c/db_stat.html">DB->stat</a>.
43
<p>If the database contains multiple databases and the <b>-s</b> flag is
44
not specified, the statistics are for the internal database that describes
45
the other databases the file contains, and not for the file as a whole.
46
<p><dt><b>-e</b><dd>Display current environment statistics.
47
<p><dt><b>-f</b><dd>Display only those database statistics that can be
48
acquired without traversing the database.
49
<p><dt><b>-h</b><dd>Specify a home directory for the database environment; by
50
default, the current working directory is used.
51
<p><dt><b>-l</b><dd>Display log region statistics, as described in <a href="../api_c/log_stat.html">DB_ENV->log_stat</a>.
52
<p><dt><b>-M</b><dd>Display internal information about the shared memory buffer pool. (The
53
output from this option is often both voluminous and meaningless, and is
54
intended only for debugging.)
56
<p><dt>A<dd>Display all information.
57
<dt>h<dd>Display buffers within hash chains.
58
<dt>m<dd>Display region memory information.
60
<p><dt><b>-m</b><dd>Display shared memory buffer pool statistics, as described in
61
<a href="../api_c/memp_stat.html">DB_ENV->memp_stat</a>.
62
<p><dt><b>-N</b><dd>Do not acquire shared region mutexes while running. Other problems,
63
such as potentially fatal errors in Berkeley DB, will be ignored as well.
64
This option is intended only for debugging errors, and should not be
65
used under any other circumstances.
66
<p><dt><b>-P</b><dd>Specify an environment password. Although Berkeley DB utilities overwrite
67
password strings as soon as possible, be aware there may be a window of
68
vulnerability on systems where unprivileged users can see command-line
69
arguments or where utilities are not able to overwrite the memory
70
containing the command-line arguments.
71
<p><dt><b>-r</b><dd>Display replication statistics, as described in <a href="../api_c/rep_stat.html">DB_ENV->rep_stat</a>.
72
<p><dt><b>-s</b><dd>Display statistics for the specified database contained in the file
73
specified with the <b>-d</b> flag.
74
<p><dt><b>-t</b><dd>Display transaction region statistics, as described in <a href="../api_c/txn_stat.html">DB_ENV->txn_stat</a>.
75
<p><dt><b>-V</b><dd>Write the library version number to the standard output, and exit.
76
<p><dt><b>-Z</b><dd>Reset the statistics after reporting them; valid only with the
77
<b>-c</b>, <b>-e</b>, <b>-l</b>, <b>-m</b>, and <b>-t</b>
80
<p>Values normally displayed in quantities of bytes are displayed as a
81
combination of gigabytes (GB), megabytes (MB), kilobytes (KB), and bytes
82
(B). Otherwise, values smaller than 10 million are displayed without
83
any special notation, and values larger than 10 million are displayed
84
as a number followed by "M".
85
<p>The db_stat utility may be used with a Berkeley DB environment (as described for the
86
<b>-h</b> option, the environment variable <b>DB_HOME</b>, or
87
because the utility was run in a directory containing a Berkeley DB
88
environment). In order to avoid environment corruption when using a
89
Berkeley DB environment, db_stat should always be given the chance to
90
detach from the environment and exit gracefully. To cause db_stat
91
to release all environment resources and exit cleanly, send it an
92
interrupt signal (SIGINT).
93
<p>The db_stat utility exits 0 on success, and >0 if an error occurs.
94
<h1>Environment Variables</h1>
96
<p><dt>DB_HOME<dd>If the <b>-h</b> option is not specified and the environment variable
97
DB_HOME is set, it is used as the path of the database home, as described
98
in <a href="../api_c/env_open.html">DB_ENV->open</a>.
101
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>