Debian Codegraph @

docs/api_reference/C/envset_lg_max.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;set_lg_max()</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 7.  The DB_LSN Handle" />
11 <link rel="prev" href="envset_lg_filemode.html" title="DB_ENV-&gt;set_lg_filemode()" />
12 <link rel="next" href="envset_lg_regionmax.html" title="DB_ENV-&gt;set_lg_regionmax()" />
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;set_lg_max()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envset_lg_filemode.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 7. 
26 The DB_LSN Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envset_lg_regionmax.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_max"></a>DB_ENV-&gt;set_lg_max()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;set_lg_max(DB_ENV *dbenv, u_int32_t lg_max); </pre>
45 <p>
46 Sets the maximum size of a single file in the log, in bytes. Because
47 <a class="link" href="lsn.html" title="Chapter 7.  The DB_LSN Handle">DB_LSN</a> file offsets are
48 unsigned four-byte values, the set value may not be larger than the
49 maximum unsigned four-byte value.
50 </p>
51 <p>
52 When the logging subsystem is configured for on-disk logging, the
53 default size of a log file is 10MB.
54 </p>
55 <p>
56 When the logging subsystem is configured for in-memory logging, the
57 default size of a log file is 256KB. In addition, the configured log
58 buffer size must be larger than the log file size. (The logging
59 subsystem divides memory configured for in-memory log records into
60 "files", as database environments configured for in-memory log records
61 may exchange log records with other members of a replication group,
62 and those members may be configured to store log records on-disk.)
63 When choosing log buffer and file sizes for in-memory logs,
64 applications should ensure the in-memory log buffer size is large
65 enough that no transaction will ever span the entire buffer, and avoid
66 a state where the in-memory buffer is full and no space can be freed
67 because a transaction that started in the first log "file" is still
68 active.
69 </p>
70 <p>
71 See <a href="../../programmer_reference/log_limits.html" class="olink">Log File Limits</a> for
72 more information.
73 </p>
74 <p>
75 The database environment's log file size may also be configured
76 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 of the entry
77 in that file is a single line with the string "set_lg_max", one or
78 more whitespace characters, and the size in bytes. Because the
79 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the database environment is opened,
80 it will silently overrule configuration done before that time.
81 </p>
82 <p>
83 The <code class="methodname">DB_ENV-&gt;set_lg_max()</code> method configures a database environment,
84 not only operations performed using the specified
85 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> handle.
86 </p>
87 <p>
88 The <code class="methodname">DB_ENV-&gt;set_lg_max()</code> method may be called at any time during the
89 life of the application.
90 </p>
91 <p>
92 If no size is specified by the application, the size last specified
93 for the database region will be used, or if no database region
94 previously existed, the default will be used.
95 </p>
96 <p>
97 The <code class="methodname">DB_ENV-&gt;set_lg_max()</code> <span>
98 <span>
99 method returns a non-zero error value on failure and 0 on success.
100 </span>
101
102 </span>
103 </p>
104 <div class="sect2" lang="en" xml:lang="en">
105 <div class="titlepage">
106 <div>
107 <div>
108 <h3 class="title"><a id="idp53052536"></a>Parameters</h3>
109 </div>
110 </div>
111 </div>
112 <div class="sect3" lang="en" xml:lang="en">
113 <div class="titlepage">
114 <div>
115 <div>
116 <h4 class="title"><a id="idp53053136"></a>lg_max</h4>
117 </div>
118 </div>
119 </div>
120 <p>
121 The <span class="bold"><strong>lg_max</strong></span> parameter is the size of a
122 single log file, in bytes.
123 </p>
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="idp53056232"></a>Errors</h3>
131 </div>
132 </div>
133 </div>
134 <p>
135 The <code class="methodname">DB_ENV-&gt;set_lg_max()</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="idp53063288"></a>EINVAL</h4>
147 </div>
148 </div>
149 </div>
150 <p>
151 If the size of the log file is less than four
152 times the size of the in-memory log buffer;
153 the specified log file size was too large; or
154 if an invalid flag value or parameter was
155 specified.
156 </p>
157 </div>
158 </div>
159 <div class="sect2" lang="en" xml:lang="en">
160 <div class="titlepage">
161 <div>
162 <div>
163 <h3 class="title"><a id="idp53062208"></a>Class</h3>
164 </div>
165 </div>
166 </div>
167 <p>
168 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>,
169 <a class="link" href="logc.html" title="The DB_LOGC Handle">DB_LOGC</a>,
170 <a class="link" href="lsn.html" title="Chapter 7.  The DB_LSN Handle">DB_LSN</a>
171 </p>
172 </div>
173 <div class="sect2" lang="en" xml:lang="en">
174 <div class="titlepage">
175 <div>
176 <div>
177 <h3 class="title"><a id="idp53052704"></a>See Also</h3>
178 </div>
179 </div>
180 </div>
181 <p>
182 <a class="xref" href="lsn.html#loglist" title="Logging Subsystem and Related Methods">Logging Subsystem and Related Methods</a>
183 </p>
184 </div>
185 </div>
186 <div class="navfooter">
187 <hr />
188 <table width="100%" summary="Navigation footer">
189 <tr>
190 <td width="40%" align="left"><a accesskey="p" href="envset_lg_filemode.html">Prev</a> </td>
191 <td width="20%" align="center">
192 <a accesskey="u" href="lsn.html">Up</a>
193 </td>
194 <td width="40%" align="right"> <a accesskey="n" href="envset_lg_regionmax.html">Next</a></td>
195 </tr>
196 <tr>
197 <td width="40%" align="left" valign="top">DB_ENV-&gt;set_lg_filemode() </td>
198 <td width="20%" align="center">
199 <a accesskey="h" href="index.html">Home</a>
200 </td>
201 <td width="40%" align="right" valign="top"> DB_ENV-&gt;set_lg_regionmax()</td>
202 </tr>
203 </table>
204 </div>
205 </body>
206 </html>