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: DB_ENV-&gt;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>DB_ENV-&gt;fileid_reset</b>
14</td>
15<td align=right>
16<a href="/api_c/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.h&gt;
23<p>
24int
25DB_ENV-&gt;fileid_reset(DB_ENV *dbenv, const char *file, u_int32_t flags);
26</pre></b>
27<hr size=1 noshade>
28<b>Description: DB_ENV-&gt;fileid_reset</b>
29<p>The DB_ENV-&gt;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 DB_ENV-&gt;fileid_reset method creates new ID
35strings for all of the databases in the physical file.</p>
36<p>The DB_ENV-&gt;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 DB_ENV-&gt;fileid_reset method may be called at any time during the life of the
39application.</p>
40<p>The DB_ENV-&gt;fileid_reset method
41returns a non-zero error value on failure
42and 0 on success.
43</p>
44<b>Parameters</b> <br>
45 <b>file</b><ul compact><li>The name of the physical file in which new file IDs are to be created.</ul>
46 <b>flags</b><ul compact><li>The <b>flags</b> parameter must be set to 0 or
47the following value:
48<br>
49<b>DB_ENCRYPT</b><ul compact><li>The file contains encrypted databases.</ul>
50<br></ul>
51<br>
52<br><b>Errors</b>
53<p>The DB_ENV-&gt;fileid_reset method
54may fail and return one of the following non-zero errors:</p>
55<br>
56<b>EINVAL</b><ul compact><li>An
57invalid flag value or parameter was specified.</ul>
58<br>
59<hr size=1 noshade>
60<br><b>Class</b>
61<a href="/api_c/env_class.html">DB_ENV</a>
62<br><b>See Also</b>
63<a href="/api_c/env_list.html">Database Environments and Related Methods</a>
64</tt>
65<table width="100%"><tr><td><br></td><td align=right>
66<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a>
67</td></tr></table>
68<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
69</body>
70</html>
71