MAN page from CentOS 8 libdb-utils-5.3.28-42.el8_4.x86_64.rpm
Section: BerkeleyDB Utilities (1)
Updated: 06 December 2016Index
- Find unused log files for archival
[-adlsVv] [-h home
] [-P password
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.
- Write all pathnames as absolute pathnames, instead of relative to thedatabase home directories.
- 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.
- 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.
- 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.
- Write the library version number to the standard output, and exit.
- 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.
utility exits 0 on success, and >0 if an error occurs.
- 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.
If the application(s) that use the environment make use of any of the following methods:
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.
- EXIT STATUS
- SEE ALSO
This document was created byman2html,using the manual pages.