Redirected restore of DB2 database from specific backup image/date

Article: 100037862
Last Published: 2013-10-24
Ratings: 0 0
Product(s): NetBackup & Alta Data Protection

Description

Performing the alternate restore on the clients and restore the database from a specific backup image

1) Modify the db2.conf file on the destination client by adding the following new object identifiers:

One to specify the alternate restore
One to define the new database
One to define the old database
One to define the new log files
One to define the old log files

For more example/info - Refer DB2 Database Admin Guide

2)On the destination client, type the DB2 RESTORE command. Type this command in the following format:

DB2 RESTORE DATABASE <database name> load <dll file path> taken at <yyyymmddhhmmss> into <new db name> redirect

<yyyymmddhhmmss> - this information can be obtained from bplist –C <client> -t 18 –l –R / output

For example, from the below bplist command output, red coloured marks is the format of the above.

DB2:\SAMPLE\node0000\20040427104236\SAMPLE.0.DB2.node0000.0.20040427104236.1
DB2:\SAMPLE\node0000\20040424103642\SAMPLE.0.DB2.node0000.0.20040424103642.1
DB2:\SAMPLE\node0000\20040423102646\SAMPLE.3.DB2.node0000.4.20040423102646.1

3) Set the location of the data files for the tablespace. Type this command in the following format:

db2 set tablespace containers for 0 using "(path path)"

where path specifies the DB2 install path.

4)  Restore the database.

Type the RESTORE command in the following format:

 db2 restore db <database name> continue

5) (Optional) Restore the transaction logs. Perform this step if one of the following is true:

The archive logs did not originally reside on a raw device.
The user exit program was used to back up the archive logs.

6) Use the DB2 ROLLFORWARDcommand to restore the logs.

Type this command in the following format:

db2 rollforward db <database name> to end of logs and stop
 

Was this content helpful?