Correct understanding of DB2 multi-partition Database Backup

Source: Internet
Author: User

This article mainly describes the actual operation steps for backing up a multi-partition DB2 database. If you encounter any operation in actual operations, however, you do not know how to solve the problem correctly, so the following articles must be good teachers and friends for you.

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,
    this parameter specifies that the restore utility is to replace the existing database 
    with the restored database.This is useful for scripts that invoke the restore utility,

     because the command line processor will not prompt the user to verify deletion of an 
    existing database.If the WITHOUT PROMPTING parameter is specified, 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 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. You do not need to perform parallel rollback DB2 multi-partition database backup:

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 an introduction to the multi-partition database backup of DB2 connector. 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.