Debian Codegraph @

docs/api_reference/CXX/envset_lg_dir.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::set_lg_dir()</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="lsn.html" title="Chapter 8.  The DbLsn Handle" />
11 <link rel="prev" href="envset_lg_bsize.html" title="DbEnv::set_lg_bsize()" />
12 <link rel="next" href="envset_lg_filemode.html" title="DbEnv::set_lg_filemode()" />
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::set_lg_dir()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envset_lg_bsize.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 8. 
26 The DbLsn Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envset_lg_filemode.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="envset_lg_dir"></a>DbEnv::set_lg_dir()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::set_lg_dir(const char *dir); </pre>
45 <p>
46 The path of a directory to be used as the location of logging files.
47 Log files created by the Log Manager subsystem will be created in this
48 directory.
49 </p>
50 <p>
51 If no logging directory is specified, log files are created in the
52 environment home directory. See
53 <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>
54 for more information.
55 </p>
56 <p>
57 For the greatest degree of recoverability from system or application
58 failure, database files and log files should be located on separate
59 physical devices.
60 </p>
61 <p>
62 The database environment's logging directory may also be
63 configured using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The syntax
64 of the entry in that file is a single line with the string
65 "set_lg_dir", one or more whitespace characters, and the directory
66 name. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the database
67 environment is opened, it will silently overrule configuration
68 done before that time. Note that if you use this method for your
69 application, and you also want to use the
70 <a class="xref" href="db_recover.html" title="db_recover">db_recover</a>,
71 <a class="xref" href="db_printlog.html" title="db_printlog">db_printlog</a>,
72 <a class="xref" href="db_archive.html" title="db_archive">db_archive</a>, or
73 <a class="xref" href="db_log_verify.html" title="db_log_verify">db_log_verify</a>
74 utilities, then you should set create a <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file and set
75 the "set_lg_dir" parameter in it.
76 </p>
77 <p>
78 The <code class="methodname">DbEnv::set_lg_dir()</code> method configures operations performed using
79 the specified <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
80 handle, not all operations performed on the underlying database
81 environment.
82 </p>
83 <p>
84 The <code class="methodname">DbEnv::set_lg_dir()</code> method may not be called after the
85 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method is called.
86 If the database environment already exists when
87 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> is called, the
88 information specified to <code class="methodname">DbEnv::set_lg_dir()</code> must be consistent with
89 the existing environment or corruption can occur.
90 </p>
91 <p>
92 The <code class="methodname">DbEnv::set_lg_dir()</code> <span>
93
94 <span>
95 method either returns a non-zero error value or throws an
96 exception that encapsulates a non-zero error value on
97 failure, and returns 0 on success.
98 </span>
99 </span>
100 </p>
101 <div class="sect2" lang="en" xml:lang="en">
102 <div class="titlepage">
103 <div>
104 <div>
105 <h3 class="title"><a id="idp8475096"></a>Parameters</h3>
106 </div>
107 </div>
108 </div>
109 <div class="sect3" lang="en" xml:lang="en">
110 <div class="titlepage">
111 <div>
112 <div>
113 <h4 class="title"><a id="idp8474448"></a>dir</h4>
114 </div>
115 </div>
116 </div>
117 <p>
118 The <span class="bold"><strong>dir</strong></span> parameter is the
119 directory used to store the logging files. This
120 directory must currently exist at environment open time.
121 </p>
122 <p>
123 When using a Unicode build on Windows (the default), the
124 <span class="bold"><strong>dir</strong></span> argument will be
125 interpreted as a UTF-8 string, which is equivalent to
126 ASCII for Latin characters.
127 </p>
128 </div>
129 </div>
130 <div class="sect2" lang="en" xml:lang="en">
131 <div class="titlepage">
132 <div>
133 <div>
134 <h3 class="title"><a id="idp8453704"></a>Errors</h3>
135 </div>
136 </div>
137 </div>
138 <p>
139 The <code class="methodname">DbEnv::set_lg_dir()</code> <span>
140
141 <span>
142 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
143 exception, encapsulating one of the following non-zero errors, or return one
144 of the following non-zero errors:
145 </span>
146 </span>
147 </p>
148 <div class="sect3" lang="en" xml:lang="en">
149 <div class="titlepage">
150 <div>
151 <div>
152 <h4 class="title"><a id="idp8486944"></a>EINVAL</h4>
153 </div>
154 </div>
155 </div>
156 <p>
157 If the method was called after <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>
158 was called; or if an invalid flag value or parameter was specified.
159 </p>
160 </div>
161 </div>
162 <div class="sect2" lang="en" xml:lang="en">
163 <div class="titlepage">
164 <div>
165 <div>
166 <h3 class="title"><a id="idp8488272"></a>Class</h3>
167 </div>
168 </div>
169 </div>
170 <p>
171 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>,
172 <a class="link" href="logc.html" title="The DbLogc Handle">DbLogc</a>,
173 <a class="link" href="lsn.html" title="Chapter 8.  The DbLsn Handle">DbLsn</a>
174 </p>
175 </div>
176 <div class="sect2" lang="en" xml:lang="en">
177 <div class="titlepage">
178 <div>
179 <div>
180 <h3 class="title"><a id="idp8475960"></a>See Also</h3>
181 </div>
182 </div>
183 </div>
184 <p>
185 <a class="xref" href="lsn.html#loglist" title="Logging Subsystem and Related Methods">Logging Subsystem and Related Methods</a>
186 </p>
187 </div>
188 </div>
189 <div class="navfooter">
190 <hr />
191 <table width="100%" summary="Navigation footer">
192 <tr>
193 <td width="40%" align="left"><a accesskey="p" href="envset_lg_bsize.html">Prev</a> </td>
194 <td width="20%" align="center">
195 <a accesskey="u" href="lsn.html">Up</a>
196 </td>
197 <td width="40%" align="right"> <a accesskey="n" href="envset_lg_filemode.html">Next</a></td>
198 </tr>
199 <tr>
200 <td width="40%" align="left" valign="top">DbEnv::set_lg_bsize() </td>
201 <td width="20%" align="center">
202 <a accesskey="h" href="index.html">Home</a>
203 </td>
204 <td width="40%" align="right" valign="top"> DbEnv::set_lg_filemode()</td>
205 </tr>
206 </table>
207 </div>
208 </body>
209 </html>