head 1.2; access; symbols RPM_4_2_1:1.1.1.5 RPM_4_2:1.1.1.5 RPM_4_1_1:1.1.1.5 RPM_4_1:1.1.1.4 RPM_4_0_5:1.1.1.3 RPM_4_0_4:1.1.1.2 RPM_4_0_3:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.55.20; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2001.07.23.20.45.38; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.07.23.20.45.38; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2002.01.08.00.30.12; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2003.01.18.13.49.02; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2001.10.15.03.47.34; author rse; state Exp; branches; next 1.1.1.5; 1.1.1.5 date 2003.01.18.14.05.00; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @ Berkeley DB Reference Guide: Berkeley DB and logging

Berkeley DB Reference Guide:
Logging Subsystem

PrevRefNext

Berkeley DB and logging

The Logging subsystem is the logging facility used by Berkeley DB. It is largely Berkeley DB-specific, although it is potentially useful outside of the Berkeley DB package for applications wanting write-ahead logging support. Applications wanting to use the log for purposes other than logging file modifications based on a set of open file descriptors will almost certainly need to make source code modifications to the Berkeley DB code base.

A log can be shared by any number of threads of control. The DB_ENV->open interface is used to open a log. When the log is no longer in use, it should be closed using the DB_ENV->close interface.

Individual log entries are identified by log sequence numbers. Log sequence numbers are stored in an opaque object, a DB_LSN.

The log_put interface is used to append new log records to the log. Optionally, the DB_CHECKPOINT flag can be used to output a checkpoint log record (indicating that the log is consistent to that point, and recoverable after a system or application failure), as well as open-file information. The log_get interface is used to retrieve log records from the log.

There are additional interfaces for integrating the log subsystem with a transaction processing system:

log_register and log_unregister
These interfaces associate files with identification numbers. These identification numbers are logged so that transactional recovery correctly associates log records with the appropriate files.

log_flush
Flushes the log up to a particular log sequence number.

log_compare
Allows applications to compare any two log sequence numbers.

log_file
Maps a log sequence number to the specific log file that contains it.

log_archive
Returns various sets of log filenames. These interfaces are used for database administration; for example, to determine if log files may safely be removed from the system.

log_stat
The display db_stat utility uses the log_stat interface to display statistics about the log.

DB_ENV->remove
The log meta-information (but not the log files themselves) may be removed using the DB_ENV->remove interface.

PrevRefNext

Copyright Sleepycat Software @ 1.1 log @Initial revision @ text @d1 1 a1 1 @ 1.1.1.1 log @Import: RPM 4.0.3 @ text @@ 1.1.1.2 log @Import: RPM 4.0.4 @ text @d1 1 a1 1 d31 3 a33 3

The DB_ENV->log_put function is used to append new log records to the log. Optionally, the DB_CHECKPOINT flag can be used to output a checkpoint log record (indicating that the log is consistent to that d35 2 a36 4 as open-file information.

The DB_ENV->log_cursor function is used to allocate a log cursor. Log cursors have two methods: DB_LOGC->get function to retrieve log records from the log, and DB_LOGC->close function to destroy the cursor. d40 1 a40 1

DB_ENV->log_register and DB_ENV->log_unregister
These interfaces associate files with identification numbers. These d43 1 a43 1

DB_ENV->log_flush
Flushes the log up to a particular log sequence number. d45 2 a46 2

DB_ENV->log_file
Maps a log sequence number to the specific log file that contains it.

DB_ENV->log_archive
Returns various sets of log filenames. These interfaces are used for d49 1 a49 1

DB_ENV->log_stat
The display db_stat utility uses the DB_ENV->log_stat interface @ 1.1.1.3 log @Import: RPM 4.0.5 @ text @d1 2 a2 2 a3 1 d30 9 a38 4 sequence numbers are stored in an opaque object, a DB_LSN.

The DB_ENV->log_cursor method is used to allocate a log cursor. Log cursors have two methods: DB_LOGC->get method to retrieve log records from the log, and DB_LOGC->close method to destroy the cursor. d42 3 a55 17

Logging Subsystem and Related MethodsDescription
DB_ENV->log_archiveList log and database files
DB_ENV->log_cursorCreate a log cursor handle
DB_ENV->log_fileMap Log Sequence Numbers to log files
DB_ENV->log_flushFlush log records
DB_ENV->log_putWrite a log record
DB_ENV->set_lg_bsizeSet log buffer size
DB_ENV->set_lg_dirSet the environment logging directory
DB_ENV->set_lg_maxSet log file size
DB_ENV->set_lg_regionmaxSet logging region size
log_compareCompare two Log Sequence Numbers
DB_ENV->log_statReturn log subsystem statistics
DB_LOGC->closeClose a log cursor
DB_LOGC->getRetrieve a log record
@ 1.1.1.4 log @Import: RPM 4.1 @ text @d1 2 a2 2 d4 1 d31 4 a34 9 sequence numbers are stored in an opaque object, a DB_LSN.

The DB_ENV->log_put function is used to append new log records to the log. Optionally, the DB_CHECKPOINT flag can be used to output a checkpoint log record (indicating that the log is consistent to that point, and recoverable after a system or application failure), as well as open-file information.

The DB_ENV->log_cursor function is used to allocate a log cursor. Log cursors have two methods: DB_LOGC->get function to retrieve log records from the log, and DB_LOGC->close function to destroy the cursor. a37 3

DB_ENV->log_register and DB_ENV->log_unregister
These interfaces associate files with identification numbers. These identification numbers are logged so that transactional recovery correctly associates log records with the appropriate files. d49 17 @ 1.1.1.5 log @Import: RPM 4.1.1 @ text @d1 2 a2 2 a3 1 d30 9 a38 4 sequence numbers are stored in an opaque object, a DB_LSN.

The DB_ENV->log_cursor method is used to allocate a log cursor. Log cursors have two methods: DB_LOGC->get method to retrieve log records from the log, and DB_LOGC->close method to destroy the cursor. d42 3 a55 17

Logging Subsystem and Related MethodsDescription
DB_ENV->log_archiveList log and database files
DB_ENV->log_cursorCreate a log cursor handle
DB_ENV->log_fileMap Log Sequence Numbers to log files
DB_ENV->log_flushFlush log records
DB_ENV->log_putWrite a log record
DB_ENV->set_lg_bsizeSet log buffer size
DB_ENV->set_lg_dirSet the environment logging directory
DB_ENV->set_lg_maxSet log file size
DB_ENV->set_lg_regionmaxSet logging region size
log_compareCompare two Log Sequence Numbers
DB_ENV->log_statReturn log subsystem statistics
DB_LOGC->closeClose a log cursor
DB_LOGC->getRetrieve a log record
@