1<!--$Id: config.so,v 10.22 2008/04/29 22:35:23 mbrey 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 Reference Guide: Configuring logging</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<a name="2"><!--meow--></a> 12<table width="100%"><tr valign=top> 13<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Logging Subsystem</dl></b></td> 14<td align=right><a href="/log/intro.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/log/limits.html"><img src="/images/next.gif" alt="Next"></a> 15</td></tr></table> 16<p align=center><b>Configuring logging</b></p> 17<p>The aspects of logging that may be configured are the size of the 18logging subsystem's region, the size of the log files on disk and the 19size of the log buffer in memory. The <a href="/api_c/env_set_lg_regionmax.html">DB_ENV->set_lg_regionmax</a> method 20specifies the size of the logging subsystem's region, in bytes. The 21logging subsystem's default size is approximately 60KB. This value may 22need to be increased if a large number of files are registered with the 23Berkeley DB log manager, for example, by opening a large number of Berkeley DB 24database files in a transactional application.</p> 25<p>The <a href="/api_c/env_set_lg_max.html">DB_ENV->set_lg_max</a> method specifies the individual log file size for 26all the applications sharing the Berkeley DB environment. Setting the log 27file size is largely a matter of convenience and a reflection of the 28application's preferences in backup media and frequency. However, 29setting the log file size too low can potentially cause problems because 30it would be possible to run out of log sequence numbers, which requires 31a full archival and application restart to reset. See 32<a href="/ref/log/limits.html">Log file limits</a> for more 33information.</p> 34<p>The <a href="/api_c/env_set_lg_bsize.html">DB_ENV->set_lg_bsize</a> method specifies the size of the in-memory log 35buffer, in bytes. Log information is stored in memory until the buffer 36fills up or transaction commit forces the buffer to be written to disk. 37Larger buffer sizes can significantly increase throughput in the 38presence of long-running transactions, highly concurrent applications, 39or transactions producing large amounts of data. By default, the buffer 40is approximately 32KB.</p> 41<p>The <a href="/api_c/env_set_lg_dir.html">DB_ENV->set_lg_dir</a> method specifies the directory in which 42log files will be placed. By default, log files are placed in 43the environment home directory.</p> 44<p>The <a href="/api_c/env_set_lg_mode.html">DB_ENV->set_lg_filemode</a> method specifies the absolute file mode for 45created log files. This method is only useful for the rare Berkeley DB 46application that does not control its umask value.</p> 47<p>The <a href="/api_c/env_log_set_config.html">DB_ENV->log_set_config</a> method configures several boolean parameters 48that control the use of file system controls such as O_DIRECT and O_DSYNC, 49automatic removal of log files, in-memory logging, and pre-zeroing of logfiles.</p> 50<table width="100%"><tr><td><br></td><td align=right><a href="/log/intro.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/log/limits.html"><img src="/images/next.gif" alt="Next"></a> 51</td></tr></table> 52<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 53</body> 54</html> 55