Difference between revisions of "RecoverDB2"

From Tranzman Documentation
Jump to: navigation, search
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==='''Step 1'''===
 
  
 +
== Headline ==
 +
For restoring the DB2 data recovered as files using Tranzman below steps need to be followed
 +
 +
In the following example, we have 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===
 +
Login to the NetBackup GUI navigate to Backup, Archive and Restore.
 +
 +
[[File:BD2-RestoreFiles.jpg]]
 +
 +
===Step 2===
 +
Click on the '''Restore Files''' tab and select the Source, Destination Client and type of Policy to restore the DB2 backup files.
 +
 +
===Step 3===
 
Restore the image on the DB2 client as a file.
 
Restore the image on the DB2 client as a file.
  
==='''Step 2'''===
+
[[File:BD2-PolicyType.jpg]]
 +
 
 +
{|style="padding: 5px; width: 85%;"
 +
| style="width: 1%;"|[[File:Note.png|30px]]|| style="padding: 10px; width: 85%;"|'''Note:''' Set Policy Type to standard, as the restore will be as flat files as opposed to DB2.
 +
|
 +
|}
 +
 
 +
===Step 4===
 +
Set a valid date range to look for the backup image. Make sure to change the '''Browse Directory''' to the '''"/"''' location, else the contents may not populate.
 +
 
 +
[[File:BD2-BrowseDirectory.jpg]]
  
Rename the file to the same naming convention as DB2 uses while backing up data locally to disk.
+
===Step 5===
 +
Select the image to recover, and start the restore process back to a location on the client machine.
  
: '''''i.e. SAMPLE.0.DB2.NODE0000.CATN000.20180523164142.001'''''
+
===Step 6===
 +
Recovered filename will have a naming convention as shown below.
  
Database Name is Sample
+
'''e.g. SAMPLE.0.DB2.NODE0000.CATN000.20180523164142.001'''
Instance Name is DB2
 
  
==='''Step 3'''===
+
* Database Name = Sample
 +
* Instance Name = DB2
 +
* Timestamp = 20180523164142
 +
* Catalog Name = CATN000
  
 +
===Step 7===
 
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"
  
 
{| 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;
 
|  
 
|  
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 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 8===
 +
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
 +
 
 +
::::::::::::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.

Latest revision as of 15:25, 7 August 2020

Headline

For restoring the DB2 data recovered as files using Tranzman below steps need to be followed

In the following example, we have 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

Login to the NetBackup GUI navigate to Backup, Archive and Restore.

BD2-RestoreFiles.jpg

Step 2

Click on the Restore Files tab and select the Source, Destination Client and type of Policy to restore the DB2 backup files.

Step 3

Restore the image on the DB2 client as a file.

BD2-PolicyType.jpg

Note.png Note: Set Policy Type to standard, as the restore will be as flat files as opposed to DB2.

Step 4

Set a valid date range to look for the backup image. Make sure to change the Browse Directory to the "/" location, else the contents may not populate.

BD2-BrowseDirectory.jpg

Step 5

Select the image to recover, and start the restore process back to a location on the client machine.

Step 6

Recovered 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 7

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 8

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.