~ubuntu-branches/ubuntu/natty/evolution-data-server/natty

« back to all changes in this revision

Viewing changes to libdb/docs/api_c/db_verify.html

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!--$Id$-->
2
 
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
 
<!--All rights reserved.-->
4
 
<!--See the file LICENSE for redistribution information.-->
5
 
<html>
6
 
<head>
7
 
<title>Berkeley DB: DB-&gt;verify</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++">
10
 
</head>
11
 
<body bgcolor=white>
12
 
<a name="2"><!--meow--></a>
13
 
<table width="100%"><tr valign=top>
14
 
<td>
15
 
<h1>DB-&gt;verify</h1>
16
 
</td>
17
 
<td align=right>
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>
19
 
</td></tr></table>
20
 
<hr size=1 noshade>
21
 
<tt>
22
 
<h3><pre>
23
 
#include &lt;db.h&gt;
24
 
<p>
25
 
int
26
 
DB-&gt;verify(DB *db, const char *file,
27
 
    const char *database, FILE *outfile, u_int32_t flags);
28
 
</pre></h3>
29
 
<h1>Description</h1>
30
 
<p>The DB-&gt;verify method verifies the integrity of all databases in the
31
 
file specified by the <b>file</b> argument, and optionally outputs the
32
 
databases' key/data pairs to the file stream specified by the
33
 
<b>outfile</b> argument.
34
 
<p>The <b>flags</b> value must be set to 0 or
35
 
the following value:
36
 
<p><dl compact>
37
 
<p><dt><a name="DB_SALVAGE">DB_SALVAGE</a><dd>Write the key/data pairs from all databases in the file to the file stream
38
 
named in
39
 
the <b>outfile</b> argument.  The output format is the same as that
40
 
specified for the <a href="../utility/db_dump.html">db_dump</a> utility, and can be used as input for
41
 
the <a href="../utility/db_load.html">db_load</a> utility.
42
 
<p>Because the key/data pairs are output in page order as opposed to the sort
43
 
order used by <a href="../utility/db_dump.html">db_dump</a>, using DB-&gt;verify to dump key/data
44
 
pairs normally produces less than optimal loads for Btree databases.
45
 
</dl>
46
 
<p>In addition, the following flags may be set by bitwise inclusively <b>OR</b>'ing them into the
47
 
<b>flags</b> parameter:
48
 
<p><dl compact>
49
 
<p><dt><a name="DB_AGGRESSIVE">DB_AGGRESSIVE</a><dd>Output <b>all</b> the key/data pairs in the file that can be found.
50
 
By default, DB-&gt;verify does not assume corruption.  For example,
51
 
if a key/data pair on a page is marked as deleted, it is not then written
52
 
to the output file.  When DB_AGGRESSIVE is specified, corruption
53
 
is assumed, and any key/data pair that can be found is written.  In this
54
 
case, key/data pairs that are corrupted or have been deleted may appear
55
 
in the output (even if the file being salvaged is in no way corrupt), and
56
 
the output will almost certainly require editing before being loaded into
57
 
a database.
58
 
<p><dt><a name="DB_PRINTABLE">DB_PRINTABLE</a><dd>When using the DB_SALVAGE flag, if characters in either the key
59
 
or data items are printing characters (as defined by <b>isprint</b>(3)), use printing characters to represent them.  This flag permits users
60
 
to use standard text editors and tools to modify the contents of
61
 
databases or selectively remove data from salvager output.
62
 
<p>Note: different systems may have different notions about what characters
63
 
are considered <i>printing characters</i>, and databases dumped in
64
 
this manner may be less portable to external systems.
65
 
<p><dt><a name="DB_NOORDERCHK">DB_NOORDERCHK</a><dd>Skip the database checks for btree and duplicate sort order and for
66
 
hashing.
67
 
<p>The DB-&gt;verify method normally verifies that btree keys and duplicate
68
 
items are correctly sorted, and hash keys are correctly hashed.  If the
69
 
file being verified contains multiple databases using differing sorting
70
 
or hashing algorithms, some of them must necessarily fail database
71
 
verification because only one sort order or hash function can be
72
 
specified before DB-&gt;verify is called.  To verify files with
73
 
multiple databases having differing sorting orders or hashing functions,
74
 
first perform verification of the file as a whole by using the
75
 
DB_NOORDERCHK flag, and then individually verify the sort order
76
 
and hashing function for each database in the file using the
77
 
DB_ORDERCHKONLY flag.
78
 
<p><dt><a name="DB_ORDERCHKONLY">DB_ORDERCHKONLY</a><dd>Perform the database checks for btree and duplicate sort order and for
79
 
hashing, skipped by DB_NOORDERCHK.
80
 
<p>When this flag is specified, a <b>database</b> argument should also be
81
 
specified, indicating the database in the physical file which is to be
82
 
checked.  This flag is only safe to use on databases that have already
83
 
successfully been verified using DB-&gt;verify with the
84
 
DB_NOORDERCHK flag set.
85
 
</dl>
86
 
<p>The database argument must be set to NULL except when the
87
 
DB_ORDERCHKONLY flag is set.
88
 
<p><b>The DB-&gt;verify method does not perform any locking, even in Berkeley DB
89
 
environments that are configured with a locking subsystem.  As such, it
90
 
should only be used on files that are not being modified by another
91
 
thread of control.</b>
92
 
<p>The DB-&gt;verify interface may not be called after the <a href="../api_c/db_open.html">DB-&gt;open</a>
93
 
interface is called.
94
 
<a name="3"><!--meow--></a>
95
 
<p>The DB-&gt;verify method returns a non-zero error value on failure, 0 on success, and <a href="../ref/program/errorret.html#DB_VERIFY_BAD">DB_VERIFY_BAD</a> if a database is corrupted.  When the
96
 
DB_SALVAGE flag is specified, the <a href="../ref/program/errorret.html#DB_VERIFY_BAD">DB_VERIFY_BAD</a> return
97
 
means that all key/data pairs in the file may not have been successfully
98
 
output.
99
 
<p>The DB-&gt;verify method is the underlying interface used by the <a href="../utility/db_verify.html">db_verify</a> utility.
100
 
See the <a href="../utility/db_verify.html">db_verify</a> utility source code for an example of using DB-&gt;verify
101
 
in a IEEE/ANSI Std 1003.1 (POSIX) environment.
102
 
<h1>Environment Variables</h1>
103
 
<p><dl compact>
104
 
<p><dt>DB_HOME<dd>If a <b>dbenv</b> argument to <a href="../api_c/db_create.html">db_create</a> was specified, the
105
 
environment variable <b>DB_HOME</b> may be used as the path of the
106
 
database environment home.
107
 
<p>DB-&gt;verify is affected by any database directory specified using the
108
 
<a href="../api_c/env_set_data_dir.html">DB_ENV-&gt;set_data_dir</a> method, or by setting the "set_data_dir" string
109
 
in the environment's <b>DB_CONFIG</b> file.
110
 
</dl>
111
 
<h1>Errors</h1>
112
 
<p>The DB-&gt;verify method may fail and return a non-zero error for the following conditions:
113
 
<p><dl compact>
114
 
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
115
 
<p>DB-&gt;verify was called after <a href="../api_c/db_open.html">DB-&gt;open</a>.
116
 
</dl>
117
 
<p>The DB-&gt;verify method may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions.
118
 
If a catastrophic error has occurred, the DB-&gt;verify method may fail and
119
 
return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>,
120
 
in which case all subsequent Berkeley DB calls will fail in the same way.
121
 
<h1>Class</h1>
122
 
<a href="../api_c/db_class.html">DB</a>
123
 
<h1>See Also</h1>
124
 
<a href="../api_c/db_list.html">Databases and Related Methods</a>
125
 
</tt>
126
 
<table width="100%"><tr><td><br></td><td align=right>
127
 
<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>
128
 
</td></tr></table>
129
 
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
130
 
</body>
131
 
</html>