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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>db_dump</title>
<link rel="stylesheet" href="apiReference.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Berkeley DB C++ API Reference" />
<link rel="up" href="utilities.html" title="Appendix A. Berkeley DB Command Line Utilities" />
<link rel="prev" href="db_deadlock.html" title="db_deadlock" />
<link rel="next" href="db_hotbackup.html" title="db_hotbackup" />
</head>
<body>
<div xmlns="" class="navheader">
<div class="libver">
<p>Library Version 11.2.5.3</p>
</div>
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">db_dump</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="db_deadlock.html">Prev</a> </td>
<th width="60%" align="center">Appendix A.
Berkeley DB Command Line Utilities
</th>
<td width="20%" align="right"> <a accesskey="n" href="db_hotbackup.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="db_dump"></a>db_dump</h2>
</div>
</div>
</div>
<pre class="programlisting">db_dump [-klNpRrV] [-b blob_dir] [-d ahr]
[-f output] [-h home] [-P password] [-s database] [-D bytes] file
db_dump [-kNpV] [-d ahr] [-f output] [-h home] -m database
db_dump185 [-p] [-f output] file </pre>
<p>
The <span class="command"><strong>db_dump</strong></span> utility reads the database file <span class="bold"><strong>file</strong></span> and writes it to the standard output using
a portable flat-text format understood by the
<a class="xref" href="db_load.html" title="db_load">db_load</a> utility. The <span class="bold"><strong>file</strong></span> argument must be a file produced using the
Berkeley DB library functions.
</p>
<p>
The <span class="command"><strong>db_dump185</strong></span> utility is
similar to the <span class="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>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>
<span class="bold"><strong>-b</strong></span>
</p>
<p>
Specifies the directory where BLOB data is stored for the
database you are dumping.
</p>
</li>
<li>
<p>
<span class="bold"><strong>-d</strong></span>
</p>
<p>
Dump the specified database in a format helpful for debugging the
Berkeley DB library routines.
</p>
<div class="itemizedlist">
<ul type="circle">
<li>
<p>
<span class="bold"><strong>a</strong></span>
</p>
<p>
Display all information. See also the
<span class="bold"><strong>-D</strong></span> option.
</p>
</li>
<li>
<p>
<span class="bold"><strong>h</strong></span>
</p>
<p>
Display only page headers.
</p>
</li>
<li>
<p>
<span class="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>
<span class="bold"><strong>The output format of the <span class="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>
<span class="bold"><strong>-D</strong></span>
</p>
<p>
Specifies the maximum number of bytes to dump for each
key/data item found in the specified database. This option is
only valid when
<span class="bold"><strong>-da</strong></span> is also specified.
This option overrides the value set for the "set_data_len"
parameter in your DB_CONFIG file, if any.
</p>
</li>
<li>
<p>
<span class="bold"><strong>-f</strong></span>
</p>
<p>
Write to the specified file instead
of to the standard output.
</p>
</li>
<li>
<p>
<span class="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>
<span class="bold"><strong>-k</strong></span>
</p>
<p>
Dump record numbers from Queue and Recno databases as keys.
</p>
</li>
<li>
<p>
<span class="bold"><strong>-l</strong></span>
</p>
<p>
List the databases stored in the file.
</p>
</li>
<li>
<p>
<span class="bold"><strong>-m</strong></span>
</p>
<p>
Specify a named in-memory database to dump.
In this case the <span class="bold"><strong>file</strong></span> argument must be omitted.
</p>
</li>
<li>
<p>
<span class="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>
<span class="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>
<span class="bold"><strong>-p</strong></span>
</p>
<p>
If characters in either the key or data items are printing characters
(as defined by <span class="bold"><strong>isprint</strong></span>(3)), use
printing characters in <span class="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 <span class="emphasis"><em>printing characters</em></span>,
and databases dumped in this manner may be less portable to external
systems.
</p>
</li>
<li>
<p>
<span class="bold"><strong>-R</strong></span>
</p>
<p>
Aggressively salvage data from a possibly corrupt file. The <span class="bold"><strong>-R</strong></span> flag differs from the <span class="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 <code class="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 <code class="literal">DB_VERIFY_BAD</code> error return.
</p>
</li>
<li>
<p>
<span class="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 <code class="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 <code class="literal">DB_VERIFY_BAD</code> error return.
</p>
</li>
<li>
<p>
<span class="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>
<span class="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. <span class="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 <a class="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 <span class="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 <span class="command"><strong>db_dump</strong></span> and <span class="command"><strong>db_dump185</strong></span> utility output
formats are documented in the
<a href="../../programmer_reference/dumpload_format.html" class="olink">Dump Output Formats</a>
section of the Berkeley DB Reference Guide.
</p>
<p>
The <span class="command"><strong>db_dump</strong></span> utility may be used with a Berkeley DB
environment (as described for the <span class="bold"><strong>-h</strong></span>
option, the environment variable
<span class="bold"><strong>DB_HOME</strong></span>, or because the utility
was run in a directory containing a Berkeley DB environment).
In order to avoid environment corruption when using a
Berkeley DB environment, <span class="command"><strong>db_dump</strong></span> should always be given the chance to
detach from the environment and exit gracefully. To cause <span class="command"><strong>db_dump</strong></span> to
release all environment resources and exit cleanly, send it an
interrupt signal (SIGINT).
</p>
<p>
Even when using a Berkeley DB database environment, the db_dump
utility does not use any kind of database locking if it is invoked
with the <span class="bold"><strong>-d</strong></span>, <span class="bold"><strong>-R</strong></span>, or <span class="bold"><strong>-r</strong></span>
arguments. If used with one of these arguments, the <span class="command"><strong>db_dump</strong></span> utility
may only be safely run on databases that are not being modified by any
other process; otherwise, the output may be corrupt.
</p>
<p>
The <span class="command"><strong>db_dump</strong></span> utility exits 0 on success, and >0 if an error occurs.
Note that this utility might return <code class="literal">DB_VERIFY_BAD</code> if the
<code class="literal">-R</code> or <code class="literal">-r</code> command line
options are used. This indicates a corrupt database. However, the
dump may still have been successful.
</p>
<p>
The <span class="command"><strong>db_dump185</strong></span> utility
exits 0 on success, and >0 if an error occurs.
</p>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="idp10652584"></a>Environment Variables</h3>
</div>
</div>
</div>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a id="idp10652896"></a>DB_HOME</h4>
</div>
</div>
</div>
<p>
If the <span class="bold"><strong>-h</strong></span> 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
the <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method.
</p>
</div>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="db_deadlock.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="utilities.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="db_hotbackup.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">db_deadlock </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> db_hotbackup</td>
</tr>
</table>
</div>
</body>
</html>
|