2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB Reference Guide: Dump output formats</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
<table width="100%"><tr valign=top>
13
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Dumping and Reloading</dl></h3></td>
14
<td align=right><a href="../../ref/dumpload/utility.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/dumpload/text.html"><img src="../../images/next.gif" alt="Next"></a>
17
<h1 align=center>Dump output formats</h1>
18
<p>There are two output formats used by <a href="../../utility/db_dump.html">db_dump</a> and <a href="../../utility/db_dump.html">db_dump185</a>.
19
<p>In both output formats, the first few lines of the output contain header
20
information describing the underlying access method, filesystem page size,
21
and other bookkeeping information.
22
<p>The header information starts with a single line, VERSION=N, where N is
23
the version number of the dump output format.
24
<p>The header information is then output in name=value pairs, where name may
25
be any of the keywords listed in the <a href="../../utility/db_load.html">db_load</a> manual page, and
26
value will be its value. Although this header information can be manually
27
edited before the database is reloaded, there is rarely any reason to do
28
so because all of this information can also be specified or overridden by
29
command-line arguments to <a href="../../utility/db_load.html">db_load</a>.
30
<p>The header information ends with single line HEADER=END.
31
<p>Following the header information are the key/data pairs from the
32
database. If the database being dumped is a Btree or Hash database, or
33
if the <b>-k</b> option was specified, the output will be paired lines
34
of text where the first line of the pair is the key item, and the second
35
line of the pair is its corresponding data item. If the database being
36
dumped is a Queue or Recno database, and the <b>-k</b> option was not
37
specified, the output will be lines of text where each line is the next
38
data item for the database. Each of these lines is preceded by a single
40
<p>If the <b>-p</b> option to <a href="../../utility/db_dump.html">db_dump</a> or <a href="../../utility/db_dump.html">db_dump185</a> was
41
specified, the key/data lines will consist of single characters
42
representing any characters from the database that are <i>printing
43
characters</i> and backslash (<b>\</b>) escaped characters
44
for any that were not. Backslash characters appearing in the output mean
45
one of two things: if the backslash character precedes another backslash
46
character, it means that a literal backslash character occurred in the
47
key or data item. If the backslash character precedes any other
48
character, the next two characters must be interpreted as hexadecimal
49
specification of a single character; for example, <b>\0a</b>
50
is a newline character in the ASCII character set.
51
<p>Although some care should be exercised, it is perfectly reasonable to use
52
standard text editors and tools to edit databases dumped using the
53
<b>-p</b> option before reloading them using the <a href="../../utility/db_load.html">db_load</a>
55
<p>Note that the definition of a printing character may vary from system to
56
system, so database representations created using the <b>-p</b>
57
option may be less portable than those created without it.
58
<p>If the <b>-p</b> option to <a href="../../utility/db_dump.html">db_dump</a> or <a href="../../utility/db_dump.html">db_dump185</a> is
59
not specified, each output line will consist of paired hexadecimal values;
60
for example, the line <b>726f6f74</b> is the string <b>root</b> in
61
the ASCII character set.
62
<p>In all output formats, the key and data items are ended by a single line
64
<p>Where multiple databases have been dumped from a file, the overall output
65
will repeat; that is, a new set of headers and a new set of data items.
66
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/dumpload/utility.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/dumpload/text.html"><img src="../../images/next.gif" alt="Next"></a>
68
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>