Debian Codegraph @

docs/api_reference/C/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>DB_ENV-&gt;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 DB_ENV Handle" />
11 <link rel="prev" href="envlog_verify.html" title="DB_ENV-&gt;log_verify()" />
12 <link rel="next" href="envopen.html" title="DB_ENV-&gt;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">DB_ENV-&gt;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 DB_ENV 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>DB_ENV-&gt;lsn_reset()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;lsn_reset(DB_ENV *dbenv, const char *file, u_int32_t flags); </pre>
45 <p>
46 The <code class="methodname">DB_ENV-&gt;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">DB_ENV-&gt;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">DB_ENV-&gt;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">DB_ENV-&gt;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">DB_ENV-&gt;lsn_reset()</code> <span>
74 <span>
75 method returns a non-zero error value on failure and 0 on success.
76 </span>
77
78 </span>
79 </p>
80 <div class="sect2" lang="en" xml:lang="en">
81 <div class="titlepage">
82 <div>
83 <div>
84 <h3 class="title"><a id="idp51662856"></a>Parameters</h3>
85 </div>
86 </div>
87 </div>
88 <div class="sect3" lang="en" xml:lang="en">
89 <div class="titlepage">
90 <div>
91 <div>
92 <h4 class="title"><a id="idp51662512"></a>file</h4>
93 </div>
94 </div>
95 </div>
96 <p>
97 The name of the physical file in which the LSNs are to be cleared.
98 </p>
99 </div>
100 <div class="sect3" lang="en" xml:lang="en">
101 <div class="titlepage">
102 <div>
103 <div>
104 <h4 class="title"><a id="idp51668992"></a>flags</h4>
105 </div>
106 </div>
107 </div>
108 <p>
109 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
110 or the following value:
111 </p>
112 <div class="itemizedlist">
113 <ul type="disc">
114 <li>
115 <p>
116 <code class="literal">DB_ENCRYPT</code>
117 </p>
118 <p>
119 The file contains encrypted databases.
120 </p>
121 </li>
122 </ul>
123 </div>
124 </div>
125 </div>
126 <div class="sect2" lang="en" xml:lang="en">
127 <div class="titlepage">
128 <div>
129 <div>
130 <h3 class="title"><a id="idp51670176"></a>Errors</h3>
131 </div>
132 </div>
133 </div>
134 <p>
135 The <code class="methodname">DB_ENV-&gt;lsn_reset()</code> <span>
136 <span>
137 method may fail and return one of the following non-zero errors:
138 </span>
139
140 </span>
141 </p>
142 <div class="sect3" lang="en" xml:lang="en">
143 <div class="titlepage">
144 <div>
145 <div>
146 <h4 class="title"><a id="idp51669872"></a>EINVAL</h4>
147 </div>
148 </div>
149 </div>
150 <p>
151 An invalid flag value or parameter was specified.
152 </p>
153 </div>
154 </div>
155 <div class="sect2" lang="en" xml:lang="en">
156 <div class="titlepage">
157 <div>
158 <div>
159 <h3 class="title"><a id="idp51674208"></a>Class</h3>
160 </div>
161 </div>
162 </div>
163 <p>
164 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
165 </p>
166 </div>
167 <div class="sect2" lang="en" xml:lang="en">
168 <div class="titlepage">
169 <div>
170 <div>
171 <h3 class="title"><a id="idp51662704"></a>See Also</h3>
172 </div>
173 </div>
174 </div>
175 <p>
176 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
177 </p>
178 </div>
179 </div>
180 <div class="navfooter">
181 <hr />
182 <table width="100%" summary="Navigation footer">
183 <tr>
184 <td width="40%" align="left"><a accesskey="p" href="envlog_verify.html">Prev</a> </td>
185 <td width="20%" align="center">
186 <a accesskey="u" href="env.html">Up</a>
187 </td>
188 <td width="40%" align="right"> <a accesskey="n" href="envopen.html">Next</a></td>
189 </tr>
190 <tr>
191 <td width="40%" align="left" valign="top">DB_ENV-&gt;log_verify() </td>
192 <td width="20%" align="center">
193 <a accesskey="h" href="index.html">Home</a>
194 </td>
195 <td width="40%" align="right" valign="top"> DB_ENV-&gt;open()</td>
196 </tr>
197 </table>
198 </div>
199 </body>
200 </html>