📄 recovery.so
字号:
m4_comment([$Id: recovery.so,v 10.35 2005/06/16 17:52:20 bostic Exp $])m4_ref_title(m4_tam Applications, Recovery procedures, recovery in @transaction protected applications, transapp/logfile, transapp/hotfail)m4_p([dnlThe fifth component of the infrastructure, recovery procedures, concernsthe recoverability of the database. After any application or systemfailure, there are two possible approaches to database recovery:])m4_nlistbeginm4_nlist([dnlThere is no need for recoverability, and all databases can be re-createdfrom scratch. Although these applications may still need transactionprotection for other reasons, recovery usually consists of removing them4_db environment home directory and all files it contains, and thenrestarting the application.Such an application may use the m4_ref(DB_TXN_NOT_DURABLE) flag to avoidwriting log records.])m4_nlist([dnlIt is necessary to recover information after system or applicationfailure. In this case, recovery processing must be performed on anydatabase environments that were active at the time of the failure.Recovery processing involves running the m4_ref(db_recover) utility orcalling the m4_refT(dbenv_open) with the m4_ref(DB_RECOVER) orm4_ref(DB_RECOVER_FATAL) flags.m4_p([dnlDuring recovery processing, all database changes made by aborted orunfinished transactions are undone, and all database changes made bycommitted transactions are redone, as necessary. Database applicationsmust not be restarted until recovery completes. After recoveryfinishes, the environment is properly initialized so that applicationsmay be restarted.])])m4_nlistendm4_p([dnlIf performing recovery, there are two types of recovery processing:m4_italic(normal) and m4_italic(catastrophic). Which you choose dependson the source for the database and log files you are using to recover.])m4_p([dnlIf up-to-the-minute database and log files are accessible on a stablefilesystem, normal recovery is sufficient. Run the m4_ref(db_recover)utility or call the m4_refT(dbenv_open) specifying them4_ref(DB_RECOVER) flag. However, the normal recovery casem4_bold(never) includes recovery using hot backups of the databaseenvironment. For example, you cannot perform a hot backup of databasesand log files, restore the backup and then run normal recovery -- youmust always run catastrophic recovery when using hot backups.])m4_p([dnlIf the database or log files have been destroyed or corrupted, or normalrecovery fails, catastrophic recovery is required. For example,catastrophic failure includes the case where the disk drive on whichthe database or log files are stored has been physically destroyed, orwhen the underlying filesystem is corrupted and the operating system'snormal filesystem checking procedures cannot bring that filesystem toa consistent state. This is often difficult to detect, and a commonsign of the need for catastrophic recovery is when normal m4_db recoveryprocedures fail, or when checksum errors are displayed during normaldatabase procedures. When catastrophic recovery is necessary, take thefollowing steps:])m4_nlistbeginm4_nlist([dnlRestore the most recent snapshots of the database and log files fromthe backup media into the directory where recovery will be performed.])m4_nlist([dnlIf any log files were archived since the last snapshot was made, theyshould be restored into the directory where recovery will be performed.m4_p([dnlIf any log files are available from the database environment that failed(for example, the disk holding the database files crashed, but the diskholding the log files is fine), those log files should be copied intothe directory where recovery will be performed.])m4_p([dnlBe sure to restore all log files in the order they were written. Theorder is important because it's possible the same log file appears onmultiple backups, and you want to run recovery using the most recentversion of each log file.])m4_nlist([dnlRun the m4_ref(db_recover) utility, specifying its m4_option(c) option;or call the m4_refT(dbenv_open), specifying the m4_ref(DB_RECOVER_FATAL)flag. The catastrophic recovery process will review the logs anddatabase files to bring the environment databases to a consistent stateas of the time of the last uncorrupted log file that is found. It isimportant to realize that only transactions committed before that datewill appear in the databases.])m4_p([dnlIt is possible to re-create the database in a location different fromthe original by specifying appropriate pathnames to the m4_option(h)option of the m4_ref(db_recover) utility. In order for this to workproperly, it is important that your application refer to files by namesrelative to the database home directory or the pathname(s) specified incalls to m4_ref(dbenv_set_data_dir), instead of using fullpathnames.])])m4_nlistendm4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -