cancel
Showing results for 
Search instead for 
Did you mean: 

DB2 Restore Solution

avazquez
Level 4

Guys,

I backup db2 using NBU 7.5 with a script and it all backups fine.  Now I need to restore it to the same server under as a different database on the same server.  I looked all day long and I am completely confused.  I have checked the following sources but nothing:

 

1.  NBU DB2 Admin Guide for Unix, Windows and Linux.

2.  http://www.ibm.com/developerworks/data/library/techarticle/dm-0402chong/#figure28

3.  http://www.ebenner.com/db2dba_blog/?p=594#toc-documentation

I wonder if there is a straight forward script outthere or step-by-step that I can follow to do my restore.

I want to place the restored db into the following directory /backup.  Can I just modify the db2_restore sample script to accomplish this? 

I've tried to use the NBU recovery wizard but it does not work since I cannot login as the db2 user.  I am confident it is pretty simple, and I am just missing that "check mark".

 

Please help!

Thanks,

 

AVazquez

 

3 REPLIES 3

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

I cannot login as the db2 user....

You need to login as db2 user. The restore will only work if done by same user that performed the backup.

See the following in NBU for DB2 Admin Guide: http://www.symantec.com/docs/DOC5166

About an alternate restore (topic starts on p. 90)

p. 91: Table 4-5  Types of restores permitted

p. 93:

 

To perform an alternate restore of a DB2 database
1 Modify the db2.conf file on the destination client.
Add 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
The following example shows the keyword lines that are needed to specify the alternate restore:
.....
....
 
*** NOTE ****
I am not a db2 dba. As a backup admin, I'm not expected to have any dba skills.
For this reason, I would sit with the local db2 dba and expect him/her to assist.

 

avazquez
Level 4

@Marianne.  I have read the admin guide several times now, and I can tell you that is confusing, for example on page 94 it talks about using the "Backup, Archive andRestore Interface" but it does not work, then on the same section (step 3) talks about entering the db2 restore command:

3.  On the destination client, type the DB2 RESTORE command.
 

Type this command in the following format:
db2 restore db db_being_restored load lib_path into
new_db_name redirect

So do I still need to modify the db2.conf, use the GUI and then run a command? 

Or,

just modify the db2.conf, then run the db restore command, if this is the case:

How many commands do I need to execute on the client? 

And, how do I tell the db2 restore from which NBU backup to restore?

Thanks,

 

 

 

 

 

Thanks,

AVazquez

Abhishek_Tomar
Level 3

Hi ,

 

You have to modify db2.conf as it is an aletrnate restore.

You are restoring it on a same machine but on a different DB so it will be considered as an alternate restore.