The following articles mainly introduce the offline and online full backup of DB2 and the actual operation steps of Incremental backup and recovery, the following describes the offline and online full backup of DB2 and the actual operation steps of Incremental backup and recovery. We hope this will help you in your future studies.
DB2 offline and online full backup, Incremental backup and recovery operations
1. Full offline backup
1) first, make sure that no user uses DB2:
- $db2 list applications for db sample
2) Stop the database and restart it to disconnect all connections:
- db2stop force
- db2start
3) execute the BACKUP command: (use TSM as the backup media)
- db2 backup db sample use tsm
If the backup is successful, a timestamp is returned.
4) check that the backup is successful:
Db2 list history backup all for sample. You can see that this backup record is missing.
The return value can also be seen in the Db2adutl query command.
5) Remarks:
First, run the BACKUP command on the master node (the node where the catalog tablespace is located), and then perform this operation on other nodes.
2. Online backup:
1) First, open the database configuration parameters that support online backup:
Db2 update db cfg for sample using userexit on Enable User exit
Db2 update db cfg for sample using logretain on enable archiving logs
Db2 update db cfg for sample using trackmod on enable Incremental Backup
(Each Node must be set separately)
After these parameters are enabled, the database is in the backup pending state and requires the DB2 offline full backup of the database. Perform full offline backup. Refer to the above command.
2) The online backup command is as follows:
- db2 backup db sample online use tsm
If the backup is successful, a timestamp is returned.
3) You can also use db2adutl and db2 list history to view backup records.
4) Remarks:
Similarly, this operation is performed on each node.
The above content describes the offline and online full backup, Incremental backup, and recovery of DB2, hoping to help you in this regard.