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:
- 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
- db2_all "<<+0< db2 restore db sample into sampnew"
- db2_all "||<<-0< db2 restore db sample into sampnew without prompting"
Or
- 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