Enabling of the DB2 partitioned database in roll-back recovery mode (1)

Source: Internet
Author: User

This article describes how to enable the DB2 partitioned database in the rollback and recovery mode, and uses commands such as BACKUP, RESTORE, and ROLLFORWARD to perform BACKUP and recovery operations for your reference, hope to help you.

For the partitioned database of DB2, some directly issued DB2 commands only apply to the current partition, BACKUP and recovery of BACKUP/RESTORE) belong to this type of commands. However, for a partitioned database, because data in the same database is distributed across multiple partitions, the backup and recovery operations on the database must take into account the integrity and synchronization of data on each partition, therefore, you can add the db2_all command before the DB2 command so that the DB2 command can be executed on each partition of the database without repeatedly issuing the same command for each partition.

In addition, in DB2, a database with the rollback and recovery mode enabled uses the archive log method instead of the default loop LOG method. In this way, you can use the RESTORE command to RESTORE the backup of the database or tablespace, and then use the ROLLFORWARD command to roll back the transactions in the archive log, restore the transactions committed after the database backup time point to maximize the protection of database data. Unlike the backup and recovery commands, the rollback command can only be run on the catalog partitions of the partitioned database to implement the rollback operation for each partition of the database.

The following describes how to back up, restore, and perform rollback in a partitioned database SAMPLE with the rollback and recovery mode enabled. Assume that the database is created on a server and has four partitions. The Cataloguing partition is partition 0.

I. Backup operations on the partitioned database:

As described above, the backup operation only applies to the current partition of the partitioned database, so you need to use the "db2_all" command to back up all partitions. Here, the online backup mode is used), that is:

Db2_all "db2 backup db sample online"

However, the preceding commands are used in serial mode for backup of each partition. To improve the performance of backup operations, there is also a method that enables Parallel intervals. That is to say, add the following option before the DB2 command of the preceding command to achieve parallel command:

<+ Partition Number <: indicates that subsequent commands act on the partition.
<-Partition Number <: indicates that subsequent commands act on partitions other than this partition.
| <-Partition Number <or <-Partition Number;: indicates that subsequent commands act on partitions other than the partition, and are executed in parallel.


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.