MAN page from CentOS Other libdb-utils-5.3.28-42.el8_4.x86_64.rpm
DB_ARCHIVE
Section: BerkeleyDB Utilities (1)
Updated: 06 December 2016
Index NAME
db_archive - Find unused log files for archival
SYNOPSIS
db_archive[-adlsVv] [-h
home] [-P
password]
DESCRIPTION
The
db_archive utility writes the pathnames of log files thatare no longer in use (for example, no longer involved in activetransactions), to the standard output, one pathname per line. Theselog files should be written to backup media to provide for recovery inthe case of catastrophic failure (which also requires a snapshot of thedatabase files), but they may then be deleted from the system to reclaimdisk space.
OPTIONS
- -a
- Write all pathnames as absolute pathnames, instead of relative to thedatabase home directories.
- -d
- Remove log files that are no longer needed; no filenames are written.Automatic log file removal is likely to make catastrophic recoveryimpossible.
- -h home
- Specify a home directory for the database environment; bydefault, the current working directory is used.
- -l
- Write out the pathnames of all the database log files, whether or notthey are involved in active transactions.
- -P password
- Specify an environment password. Although Berkeley DB utilities overwritepassword strings as soon as possible, be aware there may be a window ofvulnerability on systems where unprivileged users can see command-linearguments or where utilities are not able to overwrite the memorycontaining the command-line arguments.
- -s
- Write the pathnames of all the database files that need to be archivedin order to recover the database from catastrophic failure. If any ofthe database files have not been accessed during the lifetime of thecurrent log files, db_archive will not include them in thisoutput.
It is possible that some of the files to which the log refers have sincebeen deleted from the system. In this case, db_archive willignore them. When db_recover is run, any files to which thelog refers that are not present during recovery are assumed to have beendeleted and will not be recovered.
- -V
- Write the library version number to the standard output, and exit.
- -v
- Run in verbose mode, listing the checkpoints in the log files as theyare reviewed.
Log cursor handles (returned by the DB_ENV->log_cursor method) may have openfile descriptors for log files in the database environment. Also, theBerkeley DB interfaces to the database environment logging subsystem (forexample, DB_ENV->log_put and DB_TXN->abort) may allocate log cursorsand have open file descriptors for log files as well. On operatingsystems where filesystem related system calls (for example, rename andunlink on Windows/NT) can fail if a process has an open file descriptorfor the affected file, attempting to move or remove the log files listedby db_archive may fail. All Berkeley DB internal use of log cursorsoperates on active log files only and furthermore, is short-lived innature. So, an application seeing such a failure should be restructuredto close any open log cursors it may have, and otherwise to retry theoperation until it succeeds. (Although the latter is not likely to benecessary; it is hard to imagine a reason to move or rename a log filein which transactions are being logged or aborted.)
The db_archive utility uses a Berkeley DB environment (as described for the-h option, the environment variable DB_HOME, orbecause the utility was run in a directory containing a Berkeley DBenvironment). In order to avoid environment corruption when using aBerkeley DB environment, db_archive should always be given the chance todetach from the environment and exit gracefully. To cause db_archiveto release all environment resources and exit cleanly, send it aninterrupt signal (SIGINT).
The DB_ENV->log_archive method is the underlying method used by the db_archive utility.See the db_archive utility source code for an example of usingDB_ENV->log_archive in a IEEE/ANSI Std 1003.1 (POSIX) environment.
EXIT STATUS
The
db_archive utility exits 0 on success, and >0 if an error occurs.
ENVIRONMENT
- DB_HOME
- If the -h option is not specified and the environment variableDB_HOME is set, it is used as the path of the database home, as describedin DB_ENV->open.
NOTES
If the application(s) that use the environment make use of any of the following methods:
DB_ENV->add_data_dir
DB_ENV->set_data_dir
DB_ENV->set_lg_dir
then in order for this utility to run correctly, you need a DB_CONFIG file which sets the proper paths using the add_data_dir, or set_lg_dir configuration parameters.
SEE ALSO
db_checkpoint(1)
db_deadlock(1)
db_dump(1)
db_hotbackup(1)
db_log_verify(1)
db_load(1)
db_printlog(1)
db_recover(1)
db_replicate(1)
db_stat(1)
db_tuner(1)
db_upgrade(1)
db_verify(1)
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- OPTIONS
- EXIT STATUS
- ENVIRONMENT
- NOTES
- SEE ALSO
This document was created byman2html,using the manual pages.