DB2 Incremental backup method

Source: Internet
Author: User
Tags db2 connect db2 connect to db2 insert

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.