Debian Codegraph @

docs/api_reference/CXX/envfileid_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::fileid_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="envfailchk.html" title="DbEnv::failchk()" />
12 <link rel="next" href="envfullversion.html" title="DbEnv::full_version()" />
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::fileid_reset()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envfailchk.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="envfullversion.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="envfileid_reset"></a>DbEnv::fileid_reset()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::fileid_reset(const char *file, u_int32_t flags);</pre>
45 <p>
46 The <code class="methodname">DbEnv::fileid_reset()</code> method allows database files to be copied,
47 and then the copy used in the same database environment as the
48 original.
49 </p>
50 <p>
51 All databases contain an ID string used to identify the database in
52 the database environment cache. If a physical database file is
53 copied, and used in the same environment as another file with the same
54 ID strings, corruption can occur. The <code class="methodname">DbEnv::fileid_reset()</code> method
55 creates new ID strings for all of the databases in the physical file.
56 </p>
57 <p>
58 The <code class="methodname">DbEnv::fileid_reset()</code> method modifies the physical file,
59 in-place. Applications should not reset IDs in files that are
60 currently in use.
61 </p>
62 <p>
63 The <code class="methodname">DbEnv::fileid_reset()</code> method may be called at any time during
64 the life of the application.
65 </p>
66 <p>
67 The <code class="methodname">DbEnv::fileid_reset()</code> <span>
68
69 <span>
70 method either returns a non-zero error value or throws an
71 exception that encapsulates a non-zero error value on
72 failure, and returns 0 on success.
73 </span>
74 </span>
75 </p>
76 <div class="sect2" lang="en" xml:lang="en">
77 <div class="titlepage">
78 <div>
79 <div>
80 <h3 class="title"><a id="idp6772320"></a>Parameters</h3>
81 </div>
82 </div>
83 </div>
84 <div class="sect3" lang="en" xml:lang="en">
85 <div class="titlepage">
86 <div>
87 <div>
88 <h4 class="title"><a id="idp6771672"></a>file</h4>
89 </div>
90 </div>
91 </div>
92 <p>
93 The name of the physical file in which new file IDs are to be created.
94 </p>
95 </div>
96 <div class="sect3" lang="en" xml:lang="en">
97 <div class="titlepage">
98 <div>
99 <div>
100 <h4 class="title"><a id="idp6777184"></a>flags</h4>
101 </div>
102 </div>
103 </div>
104 <p>
105 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
106 or the following value:
107 </p>
108 <div class="itemizedlist">
109 <ul type="disc">
110 <li>
111 <p>
112 <code class="literal">DB_ENCRYPT</code>
113 </p>
114 <p>
115 The file contains encrypted databases.
116 </p>
117 </li>
118 </ul>
119 </div>
120 </div>
121 </div>
122 <div class="sect2" lang="en" xml:lang="en">
123 <div class="titlepage">
124 <div>
125 <div>
126 <h3 class="title"><a id="idp6778368"></a>Errors</h3>
127 </div>
128 </div>
129 </div>
130 <p>
131 The <code class="methodname">DbEnv::fileid_reset()</code> <span>
132
133 <span>
134 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
135 exception, encapsulating one of the following non-zero errors, or return one
136 of the following non-zero errors:
137 </span>
138 </span>
139 </p>
140 <div class="sect3" lang="en" xml:lang="en">
141 <div class="titlepage">
142 <div>
143 <div>
144 <h4 class="title"><a id="idp6786416"></a>EINVAL</h4>
145 </div>
146 </div>
147 </div>
148 <p>
149 An invalid flag value or parameter was specified.
150 </p>
151 </div>
152 </div>
153 <div class="sect2" lang="en" xml:lang="en">
154 <div class="titlepage">
155 <div>
156 <div>
157 <h3 class="title"><a id="idp6785120"></a>Class</h3>
158 </div>
159 </div>
160 </div>
161 <p>
162 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
163 </p>
164 </div>
165 <div class="sect2" lang="en" xml:lang="en">
166 <div class="titlepage">
167 <div>
168 <div>
169 <h3 class="title"><a id="idp6781752"></a>See Also</h3>
170 </div>
171 </div>
172 </div>
173 <p>
174 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
175 </p>
176 </div>
177 </div>
178 <div class="navfooter">
179 <hr />
180 <table width="100%" summary="Navigation footer">
181 <tr>
182 <td width="40%" align="left"><a accesskey="p" href="envfailchk.html">Prev</a> </td>
183 <td width="20%" align="center">
184 <a accesskey="u" href="env.html">Up</a>
185 </td>
186 <td width="40%" align="right"> <a accesskey="n" href="envfullversion.html">Next</a></td>
187 </tr>
188 <tr>
189 <td width="40%" align="left" valign="top">DbEnv::failchk() </td>
190 <td width="20%" align="center">
191 <a accesskey="h" href="index.html">Home</a>
192 </td>
193 <td width="40%" align="right" valign="top"> DbEnv::full_version()</td>
194 </tr>
195 </table>
196 </div>
197 </body>
198 </html>