Debian Codegraph @

docs/api_reference/C/envlog_verify.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DB_ENV-&gt;log_verify()</title>
7 <link rel="stylesheet" href="apiReference.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
10 <link rel="up" href="env.html" title="Chapter 5.  The DB_ENV Handle" />
11 <link rel="prev" href="envget_verbose.html" title="DB_ENV-&gt;get_verbose()" />
12 <link rel="next" href="envlsn_reset.html" title="DB_ENV-&gt;lsn_reset()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DB_ENV-&gt;log_verify()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envget_verbose.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 5. 
26 The DB_ENV Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envlsn_reset.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="envlog_verify"></a>DB_ENV-&gt;log_verify()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42 int
43 DB_ENV-&gt;log_verify(DB_ENV *dbenv, const DB_LOG_VERIFY_CONFIG *config);
44 </pre>
45 <p>
46 The <code class="methodname">DB_ENV-&gt;log_verify()</code> method verifies the integrity
47 of the log records of an environment and writes both error
48 and normal messages to the error/message output facility of the database environment handle.
49 </p>
50 <p>
51 The <code class="methodname">DB_ENV-&gt;log_verify()</code> method does not perform the
52 locking function, even in Berkeley DB environments that are configured with a
53 locking subsystem. Because this function does not access any database files, you can call it even when the environment has other threads of control
54 attached and running.
55
56 </p>
57 <p>
58 The <code class="methodname">DB_ENV-&gt;log_verify()</code> method is the underlying method used by the
59 <code class="methodname">DB_ENV-&gt; db_log_verify</code> utility. See the
60 <code class="methodname">DB_ENV-&gt; db_log_verify</code> utility
61 source code for an example of using <code class="methodname">DB_ENV-&gt;log_verify()</code> in a IEEE/ANSI Std
62 1003.1 (POSIX) environment.
63 </p>
64 <p>
65 The <code class="methodname">DB_ENV-&gt;log_verify()</code> method returns DB_LOG_VERIFY_BAD when either log errors
66 are detected or the internal data storage layer does not work.
67 It returns EINVAL if you specify wrong configurations.
68
69 Unless otherwise specified, the <code class="methodname">DB_ENV-&gt;log_verify()</code>
70 <span>
71 <span>
72 method returns a non-zero error value on failure and 0 on success.
73 </span>
74
75 </span>
76 </p>
77 <div class="sect2" lang="en" xml:lang="en">
78 <div class="titlepage">
79 <div>
80 <div>
81 <h3 class="title"><a id="idp51622608"></a>Parameters</h3>
82 </div>
83 </div>
84 </div>
85 <div class="sect3" lang="en" xml:lang="en">
86 <div class="titlepage">
87 <div>
88 <div>
89 <h4 class="title"><a id="idp51637632"></a>config </h4>
90 </div>
91 </div>
92 </div>
93 <p>
94 The configuration parameter of type DB_LOG_VERIFY_CONFIG is for the verification of log files.
95 A struct variable of this type must be memset to 0 before setting any configurations to it.
96 </p>
97 </div>
98 </div>
99 <div class="sect2" lang="en" xml:lang="en">
100 <div class="titlepage">
101 <div>
102 <div>
103 <h3 class="title"><a id="idp51643760"></a>DB_LOG_VERIFY_CONFIG members</h3>
104 </div>
105 </div>
106 </div>
107 <pre class="programlisting">
108 struct __db_logvrfy_config {
109 int continue_after_fail, verbose;
110 u_int32_t cachesize;
111 const char *temp_envhome;
112 const char *dbfile, *dbname;
113 DB_LSN start_lsn, end_lsn;
114 time_t start_time, end_time;
115 };
116 </pre>
117 <div class="sect3" lang="en" xml:lang="en">
118 <div class="titlepage">
119 <div>
120 <div>
121 <h4 class="title"><a id="idp51649208"></a>continue_after_fail</h4>
122 </div>
123 </div>
124 </div>
125 <p>
126 The <span class="bold"><strong>continue_after_fail</strong></span> parameter specifies whether or not continue the verification process when an error in the log is detected.
127 </p>
128 </div>
129 <div class="sect3" lang="en" xml:lang="en">
130 <div class="titlepage">
131 <div>
132 <div>
133 <h4 class="title"><a id="idp51623040"></a>verbose</h4>
134 </div>
135 </div>
136 </div>
137 <p>
138 The <span class="bold"><strong>verbose</strong></span> parameter specifies whether or not to display verbose output during the verification process.
139 </p>
140 </div>
141 <div class="sect3" lang="en" xml:lang="en">
142 <div class="titlepage">
143 <div>
144 <div>
145 <h4 class="title"><a id="idp51603944"></a>cachesize</h4>
146 </div>
147 </div>
148 </div>
149 <p>
150 The <span class="bold"><strong>cachesize</strong></span> parameter specifies the size of the cache of the temporary internal environment in bytes.
151 </p>
152 </div>
153 <div class="sect3" lang="en" xml:lang="en">
154 <div class="titlepage">
155 <div>
156 <div>
157 <h4 class="title"><a id="idp51575408"></a> temp_envhome</h4>
158 </div>
159 </div>
160 </div>
161 <p>
162 The <span class="bold"><strong>temp_envhome</strong></span> parameter is the home directory of the temporary database environment that is used internally during the verification. It can be NULL, meaning the environment and all databases are in-memory.
163 </p>
164 </div>
165 <div class="sect3" lang="en" xml:lang="en">
166 <div class="titlepage">
167 <div>
168 <div>
169 <h4 class="title"><a id="idp51616104"></a>dbfile</h4>
170 </div>
171 </div>
172 </div>
173 <p>
174 The <span class="bold"><strong>dbfile</strong></span> parameter specifies that for log records involving a database file, only those related to this database file are verified. Log records not involving database files are verified regardless of this parameter.
175 </p>
176 </div>
177 <div class="sect3" lang="en" xml:lang="en">
178 <div class="titlepage">
179 <div>
180 <div>
181 <h4 class="title"><a id="idp51642416"></a>dbname</h4>
182 </div>
183 </div>
184 </div>
185 <p>
186 The <span class="bold"><strong>dbname</strong></span> parameter specifies that for log records involving a database file, only those related to this database file are verified. Log records not involving database files are verified regardless of this parameter.
187 </p>
188 </div>
189 <div class="sect3" lang="en" xml:lang="en">
190 <div class="titlepage">
191 <div>
192 <div>
193 <h4 class="title"><a id="idp51649272"></a>start_lsn and end_lsn </h4>
194 </div>
195 </div>
196 </div>
197 <p>
198 The <span class="bold"><strong>start_lsn</strong></span>
199 and <span class="bold"><strong>end_lsn </strong></span> parameters specify the range of log records from the entire log set, that must be verified. Either of them can be [0][0], to specify an open ended range. If both of them are [0][0] (by default) the entire log is verified.
200 </p>
201 </div>
202 <div class="sect3" lang="en" xml:lang="en">
203 <div class="titlepage">
204 <div>
205 <div>
206 <h4 class="title"><a id="idp51650856"></a>start_time and end_time </h4>
207 </div>
208 </div>
209 </div>
210 <p>
211 The <span class="bold"><strong>start_time</strong></span>
212 and <span class="bold"><strong>end_time </strong></span>
213 parameters specify range of log records from the entire log set that must be verified for a time range. Either of them can be 0, to specify an open ended range. If both of them are 0 (by default), the entire log is verified.
214 </p>
215 <p>
216 Note that the time range specified is not precise, because such a time range is converted to an lsn range based on the time points we know from transaction commits and checkpoints.
217 </p>
218 <p>
219 You can specify either an lsn range or a time range. You can neither specify both nor specify an lsn and a time as a range.
220 </p>
221 </div>
222 </div>
223 <div class="sect2" lang="en" xml:lang="en">
224 <div class="titlepage">
225 <div>
226 <div>
227 <h3 class="title"><a id="idp51652192"></a>Environment Variables</h3>
228 </div>
229 </div>
230 </div>
231 <p>
232 If the database is opened within a database environment, the
233 environment variable <code class="literal">DB_HOME</code> can be used as the path of the
234 database environment home.
235 </p>
236 </div>
237 <div class="sect2" lang="en" xml:lang="en">
238 <div class="titlepage">
239 <div>
240 <div>
241 <h3 class="title"><a id="idp51621152"></a>Errors</h3>
242 </div>
243 </div>
244 </div>
245 <p>
246 The <code class="methodname">DB_ENV-&gt;log_verify()</code> <span>
247 <span>
248 method may fail and return one of the following non-zero errors:
249 </span>
250
251 </span>
252 </p>
253 <p>EINVAL or DB_LOG_VERIFY_BAD.</p>
254 </div>
255 <div class="sect2" lang="en" xml:lang="en">
256 <div class="titlepage">
257 <div>
258 <div>
259 <h3 class="title"><a id="idp51619560"></a>Class</h3>
260 </div>
261 </div>
262 </div>
263 <p>
264 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
265 </p>
266 </div>
267 <div class="sect2" lang="en" xml:lang="en">
268 <div class="titlepage">
269 <div>
270 <div>
271 <h3 class="title"><a id="idp51657832"></a>See Also</h3>
272 </div>
273 </div>
274 </div>
275 <p>
276 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
277 </p>
278 </div>
279 </div>
280 <div class="navfooter">
281 <hr />
282 <table width="100%" summary="Navigation footer">
283 <tr>
284 <td width="40%" align="left"><a accesskey="p" href="envget_verbose.html">Prev</a> </td>
285 <td width="20%" align="center">
286 <a accesskey="u" href="env.html">Up</a>
287 </td>
288 <td width="40%" align="right"> <a accesskey="n" href="envlsn_reset.html">Next</a></td>
289 </tr>
290 <tr>
291 <td width="40%" align="left" valign="top">DB_ENV-&gt;get_verbose() </td>
292 <td width="20%" align="center">
293 <a accesskey="h" href="index.html">Home</a>
294 </td>
295 <td width="40%" align="right" valign="top"> DB_ENV-&gt;lsn_reset()</td>
296 </tr>
297 </table>
298 </div>
299 </body>
300 </html>