Difference between revisions of "RecoverDB2"
Line 1: | Line 1: | ||
− | + | Steps to be followed after importing the images to NBU | |
+ | |||
+ | In the following example, there is a database called '''sample''' ; the recovery logs are included in the backup image; the database is restored; and the database is rolled forward to the end of backup timestamp. | ||
+ | __NOTOC__ | ||
+ | ===Step 1=== | ||
Restore the image on the DB2 client as a file. | Restore the image on the DB2 client as a file. | ||
− | === | + | ===Step 2=== |
− | + | Filename will have a naming convention as shown below. | |
− | + | '''e.g. SAMPLE.0.DB2.NODE0000.CATN000.20180523164142.001''' | |
Database Name is Sample | Database Name is Sample | ||
Instance Name is DB2 | Instance Name is DB2 | ||
+ | Timestamp is 20180523164142 | ||
+ | Catalog Name is CATN000 | ||
− | === | + | ===Step 3=== |
Restore the database. The example below restores the database SAMPLE from location in "C:\Backup" | Restore the database. The example below restores the database SAMPLE from location in "C:\Backup" | ||
Line 18: | Line 24: | ||
{| class="wikitable" style="padding-left: auto; color:#FFFFFF; background-color: black; width: 1100px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; | {| class="wikitable" style="padding-left: auto; color:#FFFFFF; background-color: black; width: 1100px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; | ||
| | | | ||
− | db2 => RESTORE DATABASE SAMPLE FROM "C:\Backup" TAKEN AT 20180627095334 WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING | + | > db2 => RESTORE DATABASE SAMPLE FROM "C:\Backup" TAKEN AT 20180627095334 WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING |
|} | |} | ||
+ | |||
+ | ===Step 4=== | ||
+ | Roll the logs forward to the end of the backup to make sure the database is in a consistent state. | ||
+ | |||
+ | {| class="wikitable" style="padding-left: auto; color:#FFFFFF; background-color: black; width: 1100px; FONT-FAMILY:monospace,monospace; LINE-HEIGHT:15px; white-space: pre-wrap; | ||
+ | | | ||
+ | > db2 rollforward db sample to end of backup | ||
+ | |} | ||
+ | |||
+ | Note : If log files are not included in backup images , the rollforward recovery needs to be done as per the method used for backing up logs. | ||
---- | ---- | ||
Use this link to go back to the main [[recoverydocs]] Page. | Use this link to go back to the main [[recoverydocs]] Page. |
Revision as of 08:55, 19 September 2018
Steps to be followed after importing the images to NBU
In the following example, there is a database called sample ; the recovery logs are included in the backup image; the database is restored; and the database is rolled forward to the end of backup timestamp.
Step 1
Restore the image on the DB2 client as a file.
Step 2
Filename will have a naming convention as shown below.
e.g. SAMPLE.0.DB2.NODE0000.CATN000.20180523164142.001
Database Name is Sample Instance Name is DB2 Timestamp is 20180523164142 Catalog Name is CATN000
Step 3
Restore the database. The example below restores the database SAMPLE from location in "C:\Backup"
> db2 => RESTORE DATABASE SAMPLE FROM "C:\Backup" TAKEN AT 20180627095334 WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING |
Step 4
Roll the logs forward to the end of the backup to make sure the database is in a consistent state.
> db2 rollforward db sample to end of backup |
Note : If log files are not included in backup images , the rollforward recovery needs to be done as per the method used for backing up logs.
Use this link to go back to the main recoverydocs Page.