What operations are required to implement multi-partition backup in DB2?

Source: Internet
Author: User

The following articles mainly describe the actual operation steps of DB2 multi-partition backup, the following is a detailed description of the actual operation code that we will use to implement the DB2 multi-partition backup.

Database, partitioned database, partition

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,  
  8. this parameter specifies that the restore utility is to replace the existing database with the restored database.   
  9. This is useful for scripts that invoke the restore utility,   
  10. because the command line processor will not prompt the user to verify deletion of an existing database.  
  11. If the WITHOUT PROMPTING parameter is specified, it is not necessary to specify REPLACE EXISTING,   
  12. but in this case, the operation will fail if events occur that normally require user intervention.  

To back up all the partitions in a partitioned database using multiple partitions in DB2, 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 multi-partition 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 subsequent commands are used for partitions other than this 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 to say, first perform the DB2 multi-partition backup operation on the cataloguing partition-No. 0, and then perform parallel operations on other partitions except the cataloguing partition 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" 

In linux, the above content is an introduction to the backup of the DB2 multi-partition database. I hope you will have some gains.

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.