Three methods of minimum restoration timestamp for DB2 tablespace Rollback Recovery

Source: Internet
Author: User

Dbdbs' backup and recovery are important for DBAs. In the online mode, you have enabled the rollback and recovery mode for DB2 backup, to RESTORE a table space set, run the RESTORE and ROLLFORWARD commands to RESTORE the table space set.

For a DB2 database with the roll-back recovery mode enabled (using the archive log mode), if the backup operation is completed in the online mode, when you need to restore the tablespace set, after executing the RESTORE command, you must also execute the ROLLFORWARD command to roll the tablespace to RESTORE it. To ensure that the tablespace rollback operation is successful, the rollback time must be greater than or equal to the minimum restoration timestamp required by the tablespace rollback operation. Three methods are provided to obtain the timestamp:

1. When the timestamp given by the current rolling command is smaller than the minimum restoration timestamp, the rolling command will not be able to run and prompt the rollback minimum restoration timestamp, such:

Db2 "rollforward db sample to 2005-05-28-12 using local time tablespace (userspace1 )"

The stop time of SQL1275N rollback must be greater than or equal to "2006-05-28-00.23.21.000000", because the Database "SAMPLE" on node "0" contains information updated at a specified time.

The returned information of this command indicates that the minimum restoration timestamp of the tablespace in USERSPACE1 before the rollback operation must be greater than or equal to 2006-05-28-00.23.21.20.00. Because the roll-forward command uses using local time, the timestamp is the local time.

2. query the value of the MIN_RECOVERY_TIME field in the SNAPSHOT_TBS_CFG table function, and return the minimum restore timestamp (local time) for table space rollback ):

Db2 "select substr (tablespace_name, 1, 15) as tablespace_name, min_recovery_time from table (snapshot_tbs_cfg ('sample',-1) as"
TABLESPACE_NAME MIN_RECOVERY_TIME
-----------------------------------------
SYSCATSPACE-
TEMPSPACE1-
USERSPACE1 2006-05-28-00.23.21.20.00
SYSTOOLSPACE 2006-05-12-13.02.11.000000

Four records are selected.
The minimum restoration timestamp for the rollback of the USERSPACE1 tablespace is 2006-05-28-00.23.21.20.00 ".

3. Obtain the minimum restoration timestamp (Coordinated Universal Time, UTC) of the rollback through the snapshot output of the tablespace, for example:
Db2 get snapshot for tablespaces on sample
Tablespace name = USERSPACE1
Tablespace id = 2
......
Minimum recovery time = 16:23:21. 000000
Add 8 hours to the returned minimum restoration Timestamp and convert it to a local timestamp, which is also 00.23.21.20.00, which is consistent with the results returned by the preceding two methods.

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.