The following articles mainly describe the correct operation steps for restoring the DB2 database and the related operations involved in the actual operations for restoring the DB2 database, the following is a detailed description of the relevant content, hoping to help you in this regard.
Restore database
1) manually drop the database to simulate disaster recovery of the DB2 database. perform the following operations:
- DB2 drop db sample
2) restore the backup history every time, regardless of the type, the history file will be backed up ). The timestamp here should be the latest:
- DB2 restore db sample history file use tsm taken at 20030102223107 buffer 100
3) use the DB2 recovery help tool:
- DB2ckrst -d sample -t 20030101224424 -r database
Command to return the recommended required recovery operation command.
4) follow the prompts of the help tool to perform version recovery first. The DB2 database recovery command is as follows:
- DB2 restore db sample incremental use tsm taken at 20030101224424 buffer 100
Recover the master node and other nodes.
5) when the database is in the rollforward-pending state, you need to perform the roll forward operation:
- DB2 rollforward db sample to 2003-01-12-13.27.25.000000 on all nodes and stop
Roll to the same time point. This operation must be performed on the master node.
5. Instructions:
1) recovery operations also have online and offline operations, just like backup operations.
2) Add the TABLESPACE (tablespace-name) clause to perform similar backup and recovery based on the TABLESPACE. Tablespace-level backup/recovery operations require that the database be in the archive log and Incremental backup mode.
3) In the recovery example, only version recovery is performed. If there is an updated full backup and Incremental backup image, you can perform the DB2 database recovery in sequence. Pay attention to the recommended sequence and number of times of using DB2ckrst.) then roll forward.
- DB2 force applications all
- DB2 backup db ldapDB2 to directory_or_device
DB2 restore db ldapDB2 from directory_or_device replace existing where directory_or_device is the name of the directory or device that stores the backup.
Migrate windows to linux:
- DB2move tfms export;
- create db tfms;
- DB2move tfms -u -p import > a.txt;
- DB2move tfmsw179 import -u DB2admin -p DB2admin > a.txt
Confirm execution: TERMINATE
6. Restore the database
(1) first create an empty Database: DB2 create db NewdbName
(2) DB2 restore olddbName (DB2 database recovery database name is required) taken at Times (Time Point) into NewdbName (new database name)
Note: The name of the recovered database is the same as that of the newly created database.