Demonstration of the correct operation process for backing up a multi-partition database in DB2

Source: Internet
Author: User

The following articles mainly describe the correct operation procedure for backing up a multi-partition database in DB2, as well as the detailed description of the actual operations involved in backing up a multi-partition database in DB2, the following is a detailed description of the main content of the article.

Partition, database

Cataloguing partition:

 
 
  1. Catalog database partition number = 0 

This is the directory partition.

Disconnect all connections.

 
 
  1. DB2 force applications all  
  2. DB2_all "<<+0<DB2 backup database sample to d:\data compress"  
  3. DB2_all "<<-0<DB2 backup database sample to d:\data compress"  
  4. DB2_all "<<+0< DB2 restore db sample from d:\data taken at 20090212141538 replace existing "  
  5. DB2_all "<<-0< DB2 restore db sample from d:\data taken at 20090212141630 replace existing"  
  6. replace existing  
  7. If a database with the same alias as the target database alias already exists, this parameter specifies  
  8. that the restore utility is to replace the existing database with the restored database. This is useful   
  9. for scripts that invoke the restore utility, because the command line processor will not prompt the   
  10. user to verify deletion of an existing database. If the WITHOUT PROMPTING parameter is specified,  
  11. it is not necessary to specify REPLACE EXISTING, but in this case, the operation will fail if events occur that normally require user intervention.  

To back up all the partitions in the partitioned database, we can use the role of DB2_all. Add DB2_all to the front of the statement and reference the statement in "". This statement can be executed on each partition of an instance without repeatedly issuing the same command for each partition. BACKUP can be used to operate the partitioned database in this way, except for the cataloguing partition. Because DB2 requires exclusive partitioning during backup or recovery, you must complete the backup operation before backing up other partitions.

In addition, in the "" statement after DB2_all, we can start with the following method to specify the partition for the 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 the subsequent backup commands of the DB2 multi-partition Database Act on other partitions except the partition,

In parallel.

In conclusion, the command for backing up data in a partitioned database is as follows ):

1. No parallel operation is required:

When the backup operation does not require parallel operations, there is no need to operate the cataloguing partitions first. At this time, you can use a command to perform backup operations.

DB2_all "DB2 backup database <DATABASE alias> TO <path/Device Name>"

2. Use parallel operations:

DB2_all "<+ 0 <DB2 backup database <DATABASE alias> TO <path/Device Name>" in windows)

DB2_all "| <-0 <DB2 backup database <DATABASE alias> TO <path/Device Name>"

Or

DB2_all "<-0 <; DB2 backup database <DATABASE alias> TO <path/Device Name>"

That is, the backup operation is performed on the-0 partition of the cataloguing partition first, and then the operations are performed on other partitions except the cataloguing partition at the same time to shorten the operation time, this reflects the superiority of the partitioned database.

 
 
  1. DB2 force applications all  
  2. DB2_all "<<+0<DB2 connect to churndb;DB2 backup database churndb to /DB2log/DB2buckup compress;DB2 terminate"  
  3. DB2_all "<<-0<DB2 connect to churndb;DB2 backup database churndb to /DB2log/DB2buckup compress;DB2 terminate" 

The above content is a description of the Multi-partition database backup in DB2, hoping to help you in this regard.

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.