Difference between revisions of "RecoverDB2"

From Tranzman Documentation
Jump to: navigation, search
Line 24: 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 20180919172832 with 2 buffers buffer 1024 parallelism 1 without prompting SQL2540W  Restore is successful, however a warning "2539" was encountered during Database Restore while processing in No Interrupt mode.
+
db2 => restore database sample from "C:\backup" taken at 20180919172832 with 2 buffers buffer 1024 parallelism 1 without prompting  
 +
SQL2540W  Restore is successful, however a warning "2539" was encountered during Database Restore while processing in No Interrupt mode.
 
|}
 
|}
  

Revision as of 10:27, 30 October 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 then 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 = Sample
  • Instance Name = DB2
  • Timestamp = 20180523164142
  • Catalog Name = 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 20180919172832 with 2 buffers buffer 1024 parallelism 1 without prompting SQL2540W Restore is successful, however a warning "2539" was encountered during Database Restore while processing in No Interrupt mode.

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

Rollforward Status
Input database alias = sample
Number of nodes have returned status = 1
Node number = 0
Rollforward status = DB working
Next log file to be read = S0000000.LOG
Log files processed = -
Last committed transaction = 2018-09-19-16.28.42.000000 UTC

DB20000I The ROLLFORWARD command completed successfully.

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.