Berkeley DB: db_recover
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

# db_recover |

`

###

    db_recover [-cVv] [-h home] [-t [[CC]YY]MMDDhhmm[.SS]]]

# Description

The db_recover utility must be run after an unexpected application, Berkeley DB, or system failure to restore the database to a consistent state. All committed transactions are guaranteed to appear after db_recover has run, and all uncommitted transactions will be completely undone.

The options are as follows:

-c
  Perform catastrophic recovery instead of normal recovery.

-h
  Specify a home directory for the database environment; by default, the current working directory is used.

-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. If "YY" is specified, but "CC" is not, a value for "YY" between 69 and 99 results in a "YY" value of 19. Otherwise, a "YY" value of 20 is used.
  MM
    The month of the year, from 1 to 12.
  DD
    The day of the month, from 1 to 31.
  hh
    The hour of the day, from 0 to 23.
  mm
    The minute of the hour, from 0 to 59.
  SS
    The second of the minute, from 0 to 61.

  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 version number to the standard output and exit.

-v
  Run in verbose mode.

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). For further information on creating a database snapshot, see Archival Procedures. For further information on performing recovery, see Recovery Procedures.

If the failure was not catastrophic, the files present on the system at the time of failure are sufficient to perform recovery.

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.

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).

The db_recover utility exits 0 on success, and >0 if an error occurs.

# Environment Variables

DB_HOME
  If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home, as described in DBENV->open.

# See Also

berkeley_db_svc, db_archive, db_checkpoint, db_deadlock, db_dump, db_load, db_recover, db_stat, db_upgrade, and db_verify.`

Copyright Sleepycat Software