1
<!--$Id: env_set_lg_max.so,v 10.45 2004/09/28 15:04:21 bostic Exp $-->
2
<!--Copyright 1997-2004 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: DB_ENV->set_lg_max</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
12
<table width="100%"><tr valign=top>
14
<h3>DB_ENV->set_lg_max</h3>
17
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
18
<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
26
DB_ENV->set_lg_max(DB_ENV *dbenv, u_int32_t lg_max);
29
DB_ENV->get_lg_max(DB_ENV *dbenv, u_int32_t *lg_maxp);
32
<h3>Description: DB_ENV->set_lg_max</h3>
33
<p>Set the maximum size of a single file in the log, in bytes. Because
34
<a href="../api_c/lsn_class.html">DB_LSN</a> file offsets are unsigned four-byte values, the set
35
value may not be larger than the maximum unsigned four-byte value.</p>
36
<p>When the logging subsystem is configured for on-disk logging, the
37
default size of a log file is 10MB.</p>
38
<p>When the logging subsystem is configured for in-memory logging, the
39
default size of a log file is 256KB. In addition, the configured log
40
buffer size must be larger than the log file size. (The logging
41
subsystem divides memory configured for in-memory log records into
42
"files", as database environments configured for in-memory log records
43
may exchange log records with other members of a replication group, and
44
those members may be configured to store log records on-disk.) When
45
choosing log buffer and file sizes for in-memory logs, applications
46
should ensure the in-memory log buffer size is large enough that no
47
transaction will ever span the entire buffer, and avoid a state where
48
the in-memory buffer is full and no space can be freed because a
49
transaction that started in the first log "file" is still active.</p>
50
<p>See <a href="../ref/log/limits.html">Log File Limits</a> for more
52
<p>The database environment's log file size may also be set using the environment's
53
<b>DB_CONFIG</b> file. The syntax of the entry in that file is a
54
single line with the string "set_lg_max", one or more whitespace characters,
55
and the size in bytes.
56
Because the <b>DB_CONFIG</b> file is read when the database
57
environment is opened, it will silently overrule configuration done
59
<p>The DB_ENV->set_lg_max method configures a database environment, not only operations
60
performed using the specified <a href="../api_c/env_class.html">DB_ENV</a> handle.</p>
61
<p>The DB_ENV->set_lg_max method may be called at any time during the life of the
63
If no size is specified by the application, the size last specified for
64
the database region will be used, or if no database region previously
65
existed, the default will be used.
66
<p>The DB_ENV->set_lg_max method
67
returns a non-zero error value on failure
72
<dt><b>lg_max</b><dd>The <b>lg_max</b> parameter is the size of a single log file, in bytes.
75
<p>The DB_ENV->set_lg_max method
76
may fail and return one of the following non-zero errors:</p>
78
<dt>EINVAL<dd>If the method was called after <a href="../api_c/env_open.html">DB_ENV->open</a> was called;
79
the size of the log file is less than four times the size of the in-memory
81
The specified log file size was too large; or if an
82
invalid flag value or parameter was specified.
85
<h3>Description: DB_ENV->get_lg_max</h3>
86
<p>The DB_ENV->get_lg_max method returns the maximum log file size.</p>
87
<p>The DB_ENV->get_lg_max method may be called at any time during the life of the
89
<p>The DB_ENV->get_lg_max method
90
returns a non-zero error value on failure
95
<dt><b>lg_maxp</b><dd>The DB_ENV->get_lg_max method returns the
96
maximum log file size in <b>lg_maxp</b>.
100
<a href="../api_c/env_class.html">DB_ENV</a>, <a href="../api_c/logc_class.html">DB_LOGC</a>, <a href="../api_c/lsn_class.html">DB_LSN</a>
102
<a href="../api_c/log_list.html">Logging Subsystem and Related Methods</a>
104
<table width="100%"><tr><td><br></td><td align=right>
105
<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>
107
<p><font size=1><a href="../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font>