📄 hotfail.so
字号:
m4_comment([$Id: hotfail.so,v 10.5 2005/02/10 20:02:41 bostic Exp $])m4_ref_title(m4_tam Applications, Hot failover, hot @failover, transapp/recovery, transapp/filesys)m4_p([dnlFor some applications, it may be useful to periodically snapshot thedatabase environment for use as a hot failover should the primary systemfail. The following steps can be taken to keep a backup environment inclose synchrony with an active environment. The active environment isentirely unaffected by these procedures, and both read and writeoperations are allowed during all steps described here.])m4_nlistbeginm4_nlist([dnlRun m4_ref(db_archive) m4_option(s) in the active environment toidentify all of the active environment's database files, and copy themto the backup directory.m4_p([dnlIf the database files are stored in a separate directory from the otherm4_db files, it will be simpler (and much faster!) to copy the directoryitself instead of the individual files (see m4_ref(dbenv_set_data_dir)for additional information). m4_bold([Note: if any of the databasefiles did not have an open m4_ref(Db) handle during the lifetime of thecurrent log files, m4_ref(db_archive) will not list them in itsoutput!]) This is another reason it may be simpler to use a separatedatabase file directory and copy the entire directory instead ofarchiving only the files listed by m4_ref(db_archive).])])m4_nlist([dnlRemove all existing log files from the backup directory.])m4_nlist([dnlRun m4_ref(db_archive) m4_option(l) in the active environment toidentify all of the active environment's log files, and copy them tothe backup directory.])m4_nlist([dnlRun m4_ref(db_recover) m4_option(c) in the backup directory tocatastrophically recover the copied environment.])m4_nlistendm4_p([dnlSteps 2, 3 and 4 may be repeated as often as you like. If Step 1 (theinitial copy of the database files) is repeated, then Steps 2, 3 and 4m4_bold(must) be performed at least once in order to ensure a consistentdatabase environment snapshot.])m4_p([dnlThese procedures must be integrated with your other archival procedures,of course. If you are periodically removing log files from your activeenvironment, you must be sure to copy them to the backup directorybefore removing them from the active directory. Not copying a log fileto the backup directory and subsequently running recovery with itpresent may leave the backup snapshot of the environment corrupted. Asimple way to ensure this never happens is to archive the log files inStep 2 as you remove them from the backup directory, and move inactivelog files from your active environment into your backup directory(rather than copying them), in Step 3. The following steps describethis procedure in more detail:])m4_nlistbeginm4_nlist([dnlRun m4_ref(db_archive) m4_option(s) in the active environment toidentify all of the active environment's database files, and copy themto the backup directory.])m4_nlist([dnlArchive all existing log files from the backup directory, moving themto a backup device such as CD-ROM, alternate disk, or tape.])m4_nlist([dnlRun m4_ref(db_archive) (without any option) in the active environmentto identify all of the log files in the active environment that are nolonger in use, and m4_bold(move) them to the backup directory.])m4_nlist([dnlRun m4_ref(db_archive) m4_option(l) in the active environment toidentify all of the remaining log files in the active environment, andm4_bold(copy) the log files to the backup directory.])m4_nlist([dnlRun m4_ref(db_recover) m4_option(c) in the backup directory tocatastrophically recover the copied environment.])m4_nlistendm4_p([dnlAs before, steps 2, 3, 4 and 5 may be repeated as often as you like.If Step 1 (the initial copy of the database files) is repeated, thenSteps 2 through 5 m4_bold(must) be performed at least once in order toensure a consistent database environment snapshot.])m4_p([dnlFor an example of a hot backup implementation in the m4_db distribution,see the source code for the m4_ref(db_hotbackup) utility.])m4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -