DB_RECOVER(1)
π db_recover β the glow-up your database needs after a whole disaster π
okay so bestie, welcome to DB_RECOVER(1), from the BerkeleyDB Utilities lineup. this is the page you read at 3am when everything went sideways. let's get into it β¨
πΈ NAME πΈ
db_recover β recover the database to a consistent state π«Ά
π SYNOPSIS π
db_recover [-cefVv] [-h home] [-P password] [-t [[CC]YY]MMDDhhmm[.SS]]]
β¨ DESCRIPTION β¨
so like. the db_recover utility must be run after an unexpected application, Berkeley DB, or system failure, to restore the database to a consistent state. that's the whole job. no cap.
and the tea is: all committed transactions are guaranteed to appear after db_recover has run, and all uncommitted transactions will be completely undone. we love a clean slate π
also note, this utility performs the same action as if the environment is opened with the DB_RECOVER flag. so if DB_RECOVER is specified on environment open, then use of this utility is not necessary. iykyk π
π OPTIONS π
-cβ perform catastrophic recovery instead of normal recovery. the dramatic one π-eβ retain the environment after running recovery. ngl this option will rarely be used unless aDB_CONFIGfile is present in the home directory. and if aDB_CONFIGfile is not present, then the regions will be created with default parameter values. π€·-fβ display a message on the standard output showing the percent of recovery completed. progress bar energy, we love to see it π-h homeβ specify a home directory for the database environment; by default, the current working directory is used. π-P passwordβ specify an environment password. okay so heads up: although Berkeley DB utilities overwrite password strings as soon as possible, be aware there may be a window of vulnerability on systems where unprivileged users can see command-line arguments, or where utilities are not able to overwrite the memory containing the command-line arguments. π¨ keep that in mind fr fr-tβ recover to the time specified rather than to the most current possible date. the timestamp argument should be in the form[[CC]YY]MMDDhhmm[.SS]where each pair of letters represents the following:CCβ the first two digits of the year (the century).YYβ the second two digits of the year. ifYYis specified, butCCis not, a value forYYbetween69and99results in aCCvalue of19. otherwise, aYYvalue of20is used. ποΈMMβ the month of the year, from1to12.DDβ the day of the month, from1to31.hhβ the hour of the day, from0to23.mmβ the minute of the hour, from0to59.SSβ the second of the minute, from0to61.
if the CC and YY letter pairs are not specified, the values default to the current year. if the SS letter pair is not specified, the value defaults to 0. β°
-Vβ write the library version number to the standard output, and exit. π-vβ run in verbose mode. she's chatty π¬
in the case of catastrophic recovery, an archival copy β or snapshot β of all database files must be restored, along with all of the log files written since the database file snapshot was made. (if disk space is a problem, log files may be referenced by symbolic links). π¦
if the failure was not catastrophic, the files present on the system at the time of failure are sufficient to perform recovery. easy peasy β¨
if log files are missing, db_recover will identify the missing log file(s) and fail β in which case the missing log files need to be restored and recovery performed again. π round two, bestie.
the db_recover utility uses a Berkeley DB environment (as described for the -h option, the environment variable DB_HOME, or because the utility was run in a directory containing a Berkeley DB environment). in order to avoid environment corruption when using a Berkeley DB environment, db_recover should always be given the chance to detach from the environment and exit gracefully. to cause db_recover to release all environment resources and exit cleanly, send it an interrupt signal (SIGINT). π«Ά
π EXIT STATUS π
the db_recover utility exits 0 on success, and >0 if an error occurs.
π¦ ENVIRONMENT π¦
DB_HOMEβ if the-hoption is not specified and the environment variableDB_HOMEis set, it is used as the path of the database home, as described inDB_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. π literally write it down.
π SEE ALSO π
db_archive(1) db_checkpoint(1) db_deadlock(1) db_dump(1) db_hotbackup(1) db_log_verify(1) db_load(1) db_printlog(1) db_replicate(1) db_stat(1) db_tuner(1) db_upgrade(1) db_verify(1)
and that's the whole page, bestie π this one's BerkeleyDB 5.3.28, dated 06 December 2016 β shoutout to the icons who wrote it. now go recover that database, you got this ππ
π¦ where this page comes from
- centos-stream 9: libdb-utils 5.3.28-57.el9 Β· BSD and LGPLv2 and Sleepycat and MIT
- epel 10: libdb-utils 5.3.28-64.el10_0 Β· BSD-3-Clause AND LGPL-2.1-only AND Sleepycat
- fedora 43: libdb-utils 5.3.28-66.fc43 Β· BSD-3-Clause AND LGPL-2.1-only AND Sleepycat
- fedora 44: libdb-utils 5.3.28-67.fc44 Β· BSD-3-Clause AND LGPL-2.1-only AND Sleepycat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms