1<!--$Id: env_fileid_reset.so,v 1.3 2005/12/13 16:48:01 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DbEnv::fileid_reset</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DbEnv::fileid_reset</b>
14</td>
15<td align=right>
16<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a>
17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db_cxx.h&gt;
23<p>
24int
25DbEnv::fileid_reset(const char *file, u_int32_t flags);
26</pre></b>
27<hr size=1 noshade>
28<b>Description: DbEnv::fileid_reset</b>
29<p>The DbEnv::fileid_reset method allows database files to be copied, and
30then the copy used in the same database environment as the original.</p>
31<p>All databases contain an ID string used to identify the database in the
32database environment cache.  If a physical database file is copied, and
33used in the same environment as another file with the same ID strings,
34corruption can occur.  The DbEnv::fileid_reset method creates new ID
35strings for all of the databases in the physical file.</p>
36<p>The DbEnv::fileid_reset method modifies the physical file, in-place.
37Applications should not reset IDs in files that are currently in use.</p>
38<p>The DbEnv::fileid_reset method may be called at any time during the life of the
39application.</p>
40<p>The DbEnv::fileid_reset method
41either returns a non-zero error value
42or throws an exception that encapsulates a non-zero error value on
43failure, and returns 0 on success.
44</p>
45<b>Parameters</b> <br>
46 <b>file</b><ul compact><li>The name of the physical file in which new file IDs are to be created.</ul>
47 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or
48the following value:
49<br>
50<b>DB_ENCRYPT</b><ul compact><li>The file contains encrypted databases.</ul>
51<br></ul>
52<br>
53<br><b>Errors</b>
54<p>The DbEnv::fileid_reset method
55may fail and throw
56<a href="/api_cxx/except_class.html">DbException</a>,
57encapsulating one of the following non-zero errors, or return one of
58the following non-zero errors:</p>
59<br>
60<b>EINVAL</b><ul compact><li>An
61invalid flag value or parameter was specified.</ul>
62<br>
63<hr size=1 noshade>
64<br><b>Class</b>
65<a href="/api_cxx/env_class.html">DbEnv</a>
66<br><b>See Also</b>
67<a href="/api_cxx/env_list.html">Database Environments and Related Methods</a>
68</tt>
69<table width="100%"><tr><td><br></td><td align=right>
70<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a>
71</td></tr></table>
72<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
73</body>
74</html>
75