Showing results for 
Search instead for 
Did you mean: 

DB2 alternate restore problems

Hi, attempting first alternate restore of a DB2 database using netbackup 6.5.5, something I've done many time using disk based backups, but having trouble getting NBU to restore to the new instance/database.

Source and target are on the same client (devhost), just different DB2 instances and databases. So the restore is from instance db2dev and database DEV to instance db2uat and database UAT both on client devhost. The new database will also use the same policy for it's backups once the restore is complete.

Have done the following as per admin guides and few things found on the web ->
- created file on the master server <inst-path>/netbackup/db/altnames/devhost, which contains devhost, seems silly since restoring to the same client, but did this anyway
- did not make any change to the bp.conf file on devhost, since restoring to the same client and using the same master server
- updated db2.conf for the db2uat instance to include 'alternate restore' keywords;
    SRCINST db2dev
    DESTINST db2uat

- added the keyword 'BKUP_IMAGE_PERM ANY' to the db2.conf of source instance db2dev, which added read access to everyone group to the backup image I want to restore
- can run 'bplist' as the db2uat user (instance owner) and can see the backup image I want to restore
     devhost:db2uat 2> bplist -l  -t 18 -k devhost_DB2 -R /
     -rw-rw-r-- db2dev    dbdevadm    39520748K May 26 20:31 /DB2/DEV/node0000/20100526202901/DEV.0.db2dev.node0000.537.20100526202901.4
     -rw-rw-r-- db2ecd    dbdevadm    40030132K May 26 20:30 /DB2/DEV/node0000/20100526202901/DEV.0.db2dev.node0000.537.20100526202901.3
     -rw-rw-r-- db2ecd    dbdevadm    42191924K May 26 20:29 /DB2/DEV/node0000/20100526202901/DEV.0.db2dev.node0000.537.20100526202901.2
     -rw-rw-r-- db2ecd    dbecdadm    46285616K May 26 20:29 /DB2/DEV/node0000/20100526202901/DEV.0.db2dev.node0000.537.20100526202901.1

After all that calling the restore from the command line as db2uat still ends in error, which seems to indicate the user can't read/get the backup image that bplist shows.

Restore command ->
DB2 RESTORE DATABASE DEV USER db2dev USING <passwd> LOAD /usr/openv/netbackup/bin/nbdb2.sl64 OPEN 4 SESSIONS TAKEN AT 20100526202901 ON /db2/UAT/sapdata1 DBPATH ON /db2/UAT INTO UAT NEWLOGPATH /db2/UAT/log_dir/NODE0000/ WITH 2 BUFFERS BUFFER 1024 REDIRECT

Result ->
"SQL2062N  An error occurred while accessing media "/usr/openv/netbackup/bin/nbdb2.sl64".  Reason code: "516"

When doing searches on this error basically just find that by getting bplist to work you should be able to get the restore working, well bplist works but no restore! Hoping someone might have a few ideas or advice on logs to check or tracing I can do to get more detail on the error message.
2 Replies

This was the only ting I

This was the only ting I could think of to check:

Allowing All Clients to Perform Redirected Restores
The administrator can allow all clients to restore backups belonging to other clients by creating the following empty file on the NetBackup master server:

No.Restrictions worked

Thanks Rick, got back to this problem after some leave, I've put in a 'No.Restrictions' file as suggest and alternate restore is now running fine.

I did already have a file for the 'devhost' in altnames, seems that I didn't have it setup correctly. We didn't really want to make use of a 'No.Restrictions' file since a restore from any host/instance to any other host/instance becomes possible (I believe), so we are trying to limit the target just to the development host.

Does anyone know the correct syntax/method for creating files in /usr/openv/netbackup/db/altnames/ when my source and target host are the same?
I had a file 'devhost' which contained 'devhost' but this didn't work.