Rollback of A DB2 partitioned Database

Source: Internet
Author: User

The backup image file of the DB2 partitioned database is generated through online backup. After the Restoration Operation of the DB2 partitioned database is completed, the database will be in the roll-forward and hold state, you must use the rollback operation to roll back archived logs to cancel the rollback and suspension status to make the database available.

Rollback of the DB2 partitioned database:

Because the Log Path of the new database SAMPNEW does not contain the archive log file under the Log Path of the source SAMPLE database, before the rollback operation, you need to copy the archive log file of the SAMPLE to a specific path, and then use the OVERFLOW option to specify the path when issuing the rollback command, to replace the data recovery Log Path of SAMPNEW to provide the archive log files to be used for rollback.

To find the path for storing the archive logs of the source SAMPLE Database, run the following command:

Db2_all "db2 get db cfg for sample" | grep "Path"

Path to log files =/home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/
Path to log files =/home/db2inst1/db2inst1/NODE0001/SQL00001/SQLOGDIR/
Path to log files =/home/db2inst1/db2inst1/NODE0002/SQL00001/SQLOGDIR/
Path to log files =/home/db2inst1/db2inst1/NODE0003/SQL00001/SQLOGDIR/

Assume that the archive log files of each partition are copied to/sampnew, because the rollback command can only be executed on the directory partition, therefore, the command to roll forward to the end of the daily hard disk data recovery log file in the cataloguing partition and end the rollback status should be written as follows:

Db2 "rollforward db sampnew to end of logs and complete overflow log path
/Sampnew/NODE0000/SQL00001/SQLOGDIR,
/Sampnew/NODE0001/SQL00001/SQLOGDIR on dbpartitionnum 1,
/Sampnew/NODE0002/SQL00001/SQLOGDIR on dbpartitionnum 2,
/Sampnew/NODE0003/SQL00001/SQLOGDIR on dbpartitionnum 3,
)"

Note: For partition 0, the "on dbpartitionnum 0" clause cannot be used in the OVERFLOW option; otherwise, the following error occurs:

SQL0104N An unexpected token "on" was found following "<identifier>". Expected tokens may include: ")". SQLSTATE = 42601

The command syntax is incorrect.

Three types of DB2 database backup solutions

DB2 logfilsiz parameter settings

Online Implementation of changing the DB2 page size

Create a DB2 tablespace in windows

Implementation of DB2 string connection

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.