Question

Kindly help me out in understanding the below mentioned problem.

I took a backup of a SAMPLE db on P:\BAK and the backup was successful.

Backup successful. The timestamp for this backup image is : 20130127162614

----------------------------------------------------------------------------
Comment: DB2 BACKUP SAMPLE OFFLINE
Start Time: 20130127162614
End Time: 20130127162619
Status: A
----------------------------------------------------------------------------
EID: 7 Location: P:\BAK

Then i wanted to do a test restore to a destination folder P:\REST and i used the command

C:\Users\Aritra>db2 restore db SAMPLE from P:\BAK taken at 20130127162614 to P:\
REST

and the restore was successful:

DB20000I  The RESTORE DATABASE command completed successfully.

----------------------------------------------------------------------------
Comment: RESTORE SAMPLE NO RF
Start Time: 20130127165456
End Time: 20130127165512Status: A
----------------------------------------------------------------------------
EID: 8 Location:

But i am unable to find the backup image in the destination folder P:\REST after the restore.

Kindly help me to understand what is wrong in my understanding.

Was it helpful?

Solution

As stated in the documentation for the RESTORE DATABASE command, using the TO target-directory option allows you to change the target database directory, but only if you are restoring a database that does not already exist. If the database already exists (as it does in the commands you give above), then specifying this option has no effect.

Keep in mind, too, that the database directory only holds database metadata. The rest of the data (tablespace containers, transaction log files, etc.) may be stored elsewhere on the system. If you need to relocate these files when performing a restore, you either need to use a redirected restore or, if your database is using automatic storage, specify new storage paths.

You can read more about how to perform a redirected restore.

OTHER TIPS

You need to perform a redirect restore, since you are restoring it into new FS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top