The <spanclass="command"><strong>db_dump</strong></span> utility reads the database file <spanclass="bold"><strong>file</strong></span> and writes it to the standard output using
a portable flat-text format understood by the
<aclass="xref"href="db_load.html"title="db_load">db_load</a> utility. The <spanclass="bold"><strong>file</strong></span> argument must be a file produced using the
Berkeley DB library functions.
</p>
<p>
The <spanclass="command"><strong>db_dump185</strong></span> utility is
similar to the <spanclass="command"><strong>db_dump</strong></span> utility, except that it reads databases in the
format used by Berkeley DB versions 1.85 and 1.86.
</p>
<p>
The options are as follows:
</p>
<divclass="itemizedlist">
<ultype="disc">
<li>
<p>
<spanclass="bold"><strong>-d</strong></span>
</p>
<p>
Dump the specified database in a format helpful for debugging the
Berkeley DB library routines.
</p>
<divclass="itemizedlist">
<ultype="circle">
<li>
<p>
<spanclass="bold"><strong>a</strong></span>
</p>
<p>
Display all information.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>h</strong></span>
</p>
<p>
Display only page headers.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>r</strong></span>
</p>
<p>
Do not display the free-list or pages on the free list. This mode is used by
the recovery tests.
</p>
</li>
</ul>
</div>
<p>
<spanclass="bold"><strong>The output format of the <spanclass="bold"><strong>-d</strong></span> option is not standard and may change,
without notice, between releases of the Berkeley DB
library.</strong></span>
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-f</strong></span>
</p>
<p>
Write to the specified file instead
of to the standard output.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-h</strong></span>
</p>
<p>
Specify a home directory for the database environment; by default, the
current working directory is used.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-k</strong></span>
</p>
<p>
Dump record numbers from Queue and Recno databases as keys.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-l</strong></span>
</p>
<p>
List the databases stored in the file.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-m</strong></span>
</p>
<p>
Specify a named in-memory database to dump.
In this case the <spanclass="bold"><strong>file</strong></span> argument must be omitted.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-N</strong></span>
</p>
<p>
Do not acquire shared region mutexes while running. Other problems,
such as potentially fatal errors in Berkeley DB, will be ignored as
well. This option is intended only for debugging errors, and should
not be used under any other circumstances.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-P</strong></span>
</p>
<p>
Specify an environment password. Although Berkeley DB utilities
overwrite password strings as soon as possible, be aware there may be
a window of vulnerability on systems where unprivileged users can see
command-line arguments or where utilities are not able to overwrite
the memory containing the command-line arguments.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-p</strong></span>
</p>
<p>
If characters in either the key or data items are printing characters
(as defined by <spanclass="bold"><strong>isprint</strong></span>(3)), use
printing characters in <spanclass="bold"><strong>file</strong></span> to
represent them. This option permits users to use standard text
editors and tools to modify the contents of databases.
</p>
<p>
Note: different systems may have different notions about what
characters are considered <spanclass="emphasis"><em>printing characters</em></span>,
and databases dumped in this manner may be less portable to external
systems.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-R</strong></span>
</p>
<p>
Aggressively salvage data from a possibly corrupt file. The <spanclass="bold"><strong>-R</strong></span> flag differs from the <spanclass="bold"><strong>-r</strong></span> option in that it will return all possible
data from the file at the risk of also returning already deleted or
otherwise nonsensical items. Data dumped in this fashion will almost
certainly have to be edited by hand or other means before the data is
ready for reload into another database
</p>
<p>
Note that this option causes the utility to verify the
integrity of the database before performing the database
dump. If this verification fails, the utility will exit
with error return <codeclass="literal">DB_VERIFY_BAD</code> even
though the database is successfully dumped. If you are
dumping a database known to be corrupt, you can safely
ignore a <codeclass="literal">DB_VERIFY_BAD</code> error return.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-r</strong></span>
</p>
<p>
Salvage data from a possibly corrupt file. When used on a uncorrupted
database, this option should return equivalent data to a normal dump,
but most likely in a different order.
</p>
<p>
Note that this option causes the utility to verify the
integrity of the database before performing the database
dump. If this verification fails, the utility will exit
with error return <codeclass="literal">DB_VERIFY_BAD</code> even
though the database is successfully dumped. If you are
dumping a database known to be corrupt, you can safely
ignore a <codeclass="literal">DB_VERIFY_BAD</code> error return.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-s</strong></span>
</p>
<p>
Specify a single database to dump. If no database is specified, all
databases in the database file are dumped.
</p>
</li>
<li>
<p>
<spanclass="bold"><strong>-V</strong></span>
</p>
<p>
Write the library version number to the standard output, and exit.
</p>
</li>
</ul>
</div>
<p>
Dumping and reloading Hash databases that use user-defined hash
functions will result in new databases that use the default hash
function. Although using the default hash function may not be optimal
for the new database, it will continue to work correctly.
</p>
<p>
Dumping and reloading Btree databases that use user-defined prefix or
comparison functions will result in new databases that use the default
prefix and comparison functions. <spanclass="bold"><strong>In this case,
it is quite likely that the database will be damaged beyond repair
permitting neither record storage or retrieval.</strong></span>
</p>
<p>
The only available workaround for either case is to modify the sources
for the <aclass="xref"href="db_load.html"title="db_load">db_load</a> utility
to load the database using the correct hash, prefix, and comparison
functions.
</p>
<p>
The <spanclass="command"><strong>db_dump185</strong></span> utility
may not be available on your system because it is not always built
when the Berkeley DB libraries and utilities are installed. If you
are unable to find it, see your system administrator for further
information.
</p>
<p>
The <spanclass="command"><strong>db_dump</strong></span> and <spanclass="command"><strong>db_dump185</strong></span> utility output