Sort out the online backup recovery steps
1. Find the database db2 list history backup all for xcldb
2. before the database is damaged, run the db2ckrst command to obtain the recovery sequence. skip this step if the database to be recovered is damaged. db2ckrst-d xcldb-t 20131018111438-r database is useful in Incremental Backup recovery.
3. Check and obtain the information of the backup file db2ckbkp-h C: \ db2bk2 \ XCLDB.0.DB2. node1_.catn1_.20131018111438.001
4. recover databases and log files-use the automatic search method and use the incremental automatic Parameter db2 restore database xcldb incremental automatic from c: \ db2bk2 taken at 20131018111438 logtarget C: \ DB2 \ NODE0000 \ SQL00001 \ SQLOGDIR -- manual recovery is adopted. The difference from automatic recovery is that the command does not have the automatic parameters, and each image needs to be restored one by one. this method is equivalent to Oracle's incremental difference recovery. quite interesting. do not want to detail the column, probably the recovery sequence is as follows: Incremental: Full backup-> Incremental 1-> full backup Detal: difference 2-> full backup-> difference 1-> difference 2
5. after the rollforward restore is executed, you can connect to the database and find that it is still in the ROLL-FORWARD status. -- check the current status of the database db2 rollforward db xcldb query status -- check the backup again, determine the path of the log file db2 list history backup all for xcldb -- copy the archived log after backup to the database directory cp .. /log directory/-- roll forward -- specify the log directory -- db2 rollforward db xcldb to end of logs and complete overflow log path (/db2bak/logs) -- original log directory (recommended) db2 rollforward db xcldb to end of logs and stop -- end ROLL-FORWARD status. the database changes to the normal state. db2 rollforward db xcldb complete or db2 rollforward db xcldb stop -- parameter description: logs and stop: indicates that the last log file is expected to be restored, that is, the moment before the database is damaged.
Tip: -- view the restoration progress db2 list utilities show detail