DB2 Incremental backup is a common backup method. The following describes the steps of DB2 Incremental Backup in detail. If you are interested in DB2 Incremental backup, take a look.
Test the Incremental backup database of DB2
-- Change Database parameters to support Incremental Backup
Db2 update db cfg using TRACKMOD on
-- Before performing Incremental backup, you must back up the database completely offline once.
Db2 backup db TestDB to D: \ DB2_Train
-- Insert a new record in the test table and verify the record
Db2 connect to TestDB
Db2 insert into T1 (C1, C2) values (3, 'incremental backup test ')
Db2 select * from T1
-- Execute the Incremental Backup command
Db2 backup db TestDB incremental to D: \ DB2_Train
-- Simulate a disaster. Delete the database and pay attention to the backup logs)
Db2 drop db TestDB
-- Method 1: manually restore the database based on the Incremental Backup File
Db2 restore db TestDB incremental from D: \ DB2_Train taken at 20100426080406
C: \> db2 connect to TestDB
SQL1119N cannot connect to or activate the Database "TESTDB" because the previous recovery is incomplete or is still in progress ".
SQLSTATE = 57019
Db2 restore db TestDB incremental from D: \ DB2_Train taken at 20100426080303
C: \> db2 connect to TestDB
SQL1119N cannot connect to or activate the Database "TESTDB" because the previous recovery is incomplete or is still in progress ".
SQLSTATE = 57019
C:> db2 restore db TestDB incremental from D: \ DB2_Train taken at 20100426080406
The DB20000I restore database command is successfully completed.
C: \> db2 connect to TestDB
SQL1117N cannot connect to or activate the database because it is in the ROLL-forward pending state.
"TESTDB ". SQLSTATE = 57019
-- Roll back the database to make it available
Db2 rollforward db bill_bt to end of logs and stop overflow log path "(c: \ db2log_bill_bt)" or
Db2 rollforward database testdb to end of logs and complete overflow log path ("D: \ DB2_Train \ SQLOGDIR ")
-- Test
Db2 connect to TestDB
Db2 select * from T1
-- Method 2: automatically restore the database based on the Incremental Backup File
Db2 drop db TestDB
Db2 restore db TestDB incremental automatic from D: \ DB2_Train taken at 20100426080406
-- Roll back the database to make it available
Db2 rollforward database testdb to end of logs and complete overflow log path ("D: \ DB2_Train \ SQLOGDIR ")
-- Test
Db2 connect to TestDB
Db2 select * from T1
DB2 offline backup test instance
Implementation of deleting duplicate data in DB2
Abnormal DB2 uninstall Method
DB2 common table expression usage
Database Access to DB2 tables