Two Methods for restoring DB2 partitioned Database

Source: Internet
Author: User

DB2 partitioned database recovery is divided into interval-based serial mode and interval-based parallel mode. The following describes the two DB2 partition database recovery methods for your reference.

Restore A partitioned database:

Since backup and recovery operations only apply to the current database partition, they can also be divided into serial and parallel methods. To introduce the use of the OVERFLOW option in the previous Rollback Recovery, we will restore the SAMPLE database to a new database named SAMPNEW in the same instance. The command should be:

· DB2 partitioned database recovery-interval serial mode:

 
 
  1. db2_all "db2 restore db sample into sampnew without prompting" 

Note: As it is a partitioned database, when the first partition is restored and the second partition is restored, the system displays the SQL2529W warning, indicating that the database already exists, whether to overwrite the data recovery prompt. In some platforms, such as Linux, this prompt will cause the partition database recovery operation to fail, for example:

$ Db2_all "db2 restore db sample into sapmnew"

DB20000I The restore database command completed successfully.
Rhas3: db2 restore db sample into sapmnew completed OK

SQL2529W Warning! Restoring to an existing database that is different from the backup image database, and the alias name "SAPMNEW" of the existing database do es not match the alias name "SAMPLE" of the backup image, and the database name "SAPMNEW" of the existing database does not match the database name "SAMPLE" of the backup image. the target database will be overwritten by the backup version. the Roll-forward recovery logs associated with the target database will be deleted.
Do you want to continue? (Y/n) SQL2001N The utility was interrupted. The output data may be incomplete.
Rhas3: db2 restore db sample into sapmnew completed rc = 4

Therefore, we recommend that you add the "without prompting" option to the above hard disk data recovery command to avoid this prompt.

DB2 partitioned database recovery-interval Parallel Mode

 
 
  1. db2_all "<<+0< db2 restore db sample into sampnew"  
  2. db2_all "||<<-0< db2 restore db sample into sampnew without prompting" 

Or

 
 
  1. db2_all "<<-0<; db2 restore db sample into sampnew without prompting" 

Because the catalog partition is the first partition to be restored, you do not need to add the "without prompting" option.

Because the backup image file we use is generated through online backup, after the restoration operation is complete, the database will be in the roll-up and hold state, and archive logs must be rolled back through the roll-down operation, to cancel the roll-out pending state, so that the database is available.

Three types of DB2 database backup solutions

Implementation of batch SQL script execution in DB2

Online Implementation of changing the DB2 page size

Create a DB2 tablespace in windows

Implementation of DB2 string connection

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.