Debian Codegraph @

docs/api_reference/CXX/envlsn_reset.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>DbEnv::lsn_reset()</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 DbEnv Handle" />
11 <link rel="prev" href="envlog_verify.html" title="DbEnv::log_verify()" />
12 <link rel="next" href="envopen.html" title="DbEnv::open()" />
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">DbEnv::lsn_reset()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envlog_verify.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 5. 
26 The DbEnv Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envopen.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="envlsn_reset"></a>DbEnv::lsn_reset()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::lsn_reset(const char *file, u_int32_t flags);</pre>
45 <p>
46 The <code class="methodname">DbEnv::lsn_reset()</code> method allows database files to be moved from
47 one transactional database environment to another.
48 </p>
49 <p>
50 Database pages in transactional database environments contain
51 references to the environment's log files (that is, log sequence
52 numbers, or LSNs). Copying or moving a database file from one database
53 environment to another, and then modifying it, can result in data
54 corruption if the LSNs are not first cleared.
55 </p>
56 <p>
57 Note that LSNs should be reset before moving or copying the database
58 file into a new database environment, rather than moving or copying
59 the database file and then resetting the LSNs. Berkeley DB has
60 consistency checks that may be triggered if an application calls
61 <code class="methodname">DbEnv::lsn_reset()</code> on a database in a new environment when the
62 database LSNs still reflect the old environment.
63 </p>
64 <p>
65 The <code class="methodname">DbEnv::lsn_reset()</code> method modifies the physical file, in-place.
66 Applications should not reset LSNs in files that are currently in use.
67 </p>
68 <p>
69 The <code class="methodname">DbEnv::lsn_reset()</code> method may be called at any time during the
70 life of the application.
71 </p>
72 <p>
73 The <code class="methodname">DbEnv::lsn_reset()</code> <span>
74
75 <span>
76 method either returns a non-zero error value or throws an
77 exception that encapsulates a non-zero error value on
78 failure, and returns 0 on success.
79 </span>
80 </span>
81 </p>
82 <div class="sect2" lang="en" xml:lang="en">
83 <div class="titlepage">
84 <div>
85 <div>
86 <h3 class="title"><a id="idp7006440"></a>Parameters</h3>
87 </div>
88 </div>
89 </div>
90 <div class="sect3" lang="en" xml:lang="en">
91 <div class="titlepage">
92 <div>
93 <div>
94 <h4 class="title"><a id="idp7005792"></a>file</h4>
95 </div>
96 </div>
97 </div>
98 <p>
99 The name of the physical file in which the LSNs are to be cleared.
100 </p>
101 </div>
102 <div class="sect3" lang="en" xml:lang="en">
103 <div class="titlepage">
104 <div>
105 <div>
106 <h4 class="title"><a id="idp7011136"></a>flags</h4>
107 </div>
108 </div>
109 </div>
110 <p>
111 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
112 or the following value:
113 </p>
114 <div class="itemizedlist">
115 <ul type="disc">
116 <li>
117 <p>
118 <code class="literal">DB_ENCRYPT</code>
119 </p>
120 <p>
121 The file contains encrypted databases.
122 </p>
123 </li>
124 </ul>
125 </div>
126 </div>
127 </div>
128 <div class="sect2" lang="en" xml:lang="en">
129 <div class="titlepage">
130 <div>
131 <div>
132 <h3 class="title"><a id="idp7012320"></a>Errors</h3>
133 </div>
134 </div>
135 </div>
136 <p>
137 The <code class="methodname">DbEnv::lsn_reset()</code> <span>
138
139 <span>
140 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
141 exception, encapsulating one of the following non-zero errors, or return one
142 of the following non-zero errors:
143 </span>
144 </span>
145 </p>
146 <div class="sect3" lang="en" xml:lang="en">
147 <div class="titlepage">
148 <div>
149 <div>
150 <h4 class="title"><a id="idp7020520"></a>EINVAL</h4>
151 </div>
152 </div>
153 </div>
154 <p>
155 An invalid flag value or parameter was specified.
156 </p>
157 </div>
158 </div>
159 <div class="sect2" lang="en" xml:lang="en">
160 <div class="titlepage">
161 <div>
162 <div>
163 <h3 class="title"><a id="idp7019440"></a>Class</h3>
164 </div>
165 </div>
166 </div>
167 <p>
168 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
169 </p>
170 </div>
171 <div class="sect2" lang="en" xml:lang="en">
172 <div class="titlepage">
173 <div>
174 <div>
175 <h3 class="title"><a id="idp7016288"></a>See Also</h3>
176 </div>
177 </div>
178 </div>
179 <p>
180 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
181 </p>
182 </div>
183 </div>
184 <div class="navfooter">
185 <hr />
186 <table width="100%" summary="Navigation footer">
187 <tr>
188 <td width="40%" align="left"><a accesskey="p" href="envlog_verify.html">Prev</a> </td>
189 <td width="20%" align="center">
190 <a accesskey="u" href="env.html">Up</a>
191 </td>
192 <td width="40%" align="right"> <a accesskey="n" href="envopen.html">Next</a></td>
193 </tr>
194 <tr>
195 <td width="40%" align="left" valign="top">DbEnv::log_verify() </td>
196 <td width="20%" align="center">
197 <a accesskey="h" href="index.html">Home</a>
198 </td>
199 <td width="40%" align="right" valign="top"> DbEnv::open()</td>
200 </tr>
201 </table>
202 </div>
203 </body>
204 </html>