1
<!--$Id: intro.so,v 10.18 2001/03/13 18:48:49 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB Reference Guide: Berkeley DB and logging</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
13
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Logging Subsystem</dl></h3></td>
14
<td align=right><a href="../../ref/lock/nondb.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/log/config.html"><img src="../../images/next.gif" alt="Next"></a>
17
<h1 align=center>Berkeley DB and logging</h1>
18
<p>The Logging subsystem is the logging facility used by Berkeley DB. It is
19
largely Berkeley DB-specific, although it is potentially useful outside of
20
the Berkeley DB package for applications wanting write-ahead logging support.
21
Applications wanting to use the log for purposes other than logging file
22
modifications based on a set of open file descriptors will almost
23
certainly need to make source code modifications to the Berkeley DB code
25
<p>A log can be shared by any number of threads of control. The
26
<a href="../../api_c/env_open.html">DB_ENV->open</a> interface is used to open a log. When the log is no
27
longer in use, it should be closed using the <a href="../../api_c/env_close.html">DB_ENV->close</a>
29
<p>Individual log entries are identified by log sequence numbers. Log
30
sequence numbers are stored in an opaque object, a <a href="../../api_c/db_lsn.html">DB_LSN</a>.
31
<p>The <a href="../../api_c/log_put.html">log_put</a> interface is used to append new log records to the
32
log. Optionally, the <a href="../../api_c/log_put.html#DB_CHECKPOINT">DB_CHECKPOINT</a> flag can be used to output
33
a checkpoint log record (indicating that the log is consistent to that
34
point, and recoverable after a system or application failure), as well
35
as open-file information. The <a href="../../api_c/log_get.html">log_get</a> interface is used to
36
retrieve log records from the log.
37
<p>There are additional interfaces for integrating the log subsystem with a
38
transaction processing system:
40
<p><dt><a href="../../api_c/log_register.html">log_register</a> and <a href="../../api_c/log_unregister.html">log_unregister</a><dd>These interfaces associate files with identification numbers. These
41
identification numbers are logged so that transactional recovery
42
correctly associates log records with the appropriate files.
43
<p><dt><a href="../../api_c/log_flush.html">log_flush</a><dd>Flushes the log up to a particular log sequence number.
44
<p><dt><a href="../../api_c/log_compare.html">log_compare</a><dd>Allows applications to compare any two log sequence numbers.
45
<p><dt><a href="../../api_c/log_file.html">log_file</a> <dd>Maps a log sequence number to the specific log file that contains it.
46
<p><dt><a href="../../api_c/log_archive.html">log_archive</a><dd>Returns various sets of log filenames. These interfaces are used for
47
database administration; for example, to determine if log files may
48
safely be removed from the system.
49
<p><dt><a href="../../api_c/log_stat.html">log_stat</a> <dd>The display <a href="../../utility/db_stat.html">db_stat</a> utility uses the <a href="../../api_c/log_stat.html">log_stat</a> interface
50
to display statistics about the log.
51
<p><dt><a href="../../api_c/env_remove.html">DB_ENV->remove</a><dd>The log meta-information (but not the log files themselves) may be
52
removed using the <a href="../../api_c/env_remove.html">DB_ENV->remove</a> interface.
54
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/lock/nondb.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/log/config.html"><img src="../../images/next.gif" alt="Next"></a>
56
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>