/INBerkeley DB Reference Guide: Transaction Protected Applications[PH

Berkeley DB Reference Guide: Transaction Protected Applications



8

Recovery and filesystem operations



AFilesystem operations, e.g., moving the database environment to aCdifferent machine or file creation, deletion or renaming, cannot beDtransaction protected. For this reason, files cannot be re-created,3deleted or renamed as part of the recovery process.

FIf recovery cannot find a database file referenced in the log, it willHoutput a warning message that it was unable to locate a file it expected>to find. This message is only a warning, as the file may haveFsubsequently been deleted as part of normal database operations before=the failure occurred, and so cannot be known to be a problem.

INote that committed transactions that involved these missing files areHrolled forward, even though the files were not found. If the files wereJnot intentionally deleted (e.g., they were created after the last databaseHsnapshot, but were lost during a failure), they must be manually created](using db_open), and then recovery must be redone.

FGenerally, it is simplest to perform filesystem operations at the sameAtime as making a snapshot of the database. To perform filesystem operations:

    ,

  1. Cleanly shutdown database operations.&

  2. Rename, create or delete files.'

  3. Make a snapshot of the database.%

  4. Restart database applications.


GTo cleanly shutdown database operations, all applications accessing theGdatabase environment must be shutdown and a transaction checkpoint must&be taken. If the applications are notHimplemented such that they can be shutdown gracefully (i.e., closing allIreferences to the database environment), recovery must be performed afterIall applications have been killed to ensure that the underlying databasesare consistent on disk.

MFuture versions of Berkeley DB are expected to remove the restriction thatIdatabase files must be manually created before recovery is performed.

PARÿÿ