Recovery as Normal Files(DB2)
Below documentation shows how to restore DB2 data after it has been recovered as normal files using steps as shown in Recovery as Normal Files . Please recover the DB2 database files.
Recovered filename will have a naming convention as shown below.
e.g. SAMPLE.0.DB2.NODE0000.CATN0000.20210105171743.001
Database Name = Sample Instance Name = DB2 Timestamp = 20210105171743 Catalog Name = CATN000
Once you have the files, please follow the steps to restore.
We are demonstrating recovery for SAMPLE database (shown in below picture).
Note: There are more ways to perform DB2 restore.
For more detailed information please refer to the DB2 Restore Documentation. |
Step 1
Login to DB2 Server and connect to the SAMPLE database.
db2 => connect to sample Database Connection Information Database server = DB2/NT64 9.7.0 SQL authorization ID = ADMINIST... Local database alias = SAMPLE |
Step 2
db2 => restore database sample from "C:\Temp\RestoredData" taken at 20210105171743 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 3
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 = 2021-01-05-17.17.46.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.