I Am Unable To Find The Backup Image After The Test Restore Got Completed Successfully
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.
Answer
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.
Related Questions
- → Variable which replace DB of name in SSMS
- → DB2 audit performance impact
- → DB2 : ' ' taking as null while insert
- → When date is Null return another value? - DB2 database
- → Creating sequential rows in DB table when Clob spills
- → Update 3 column in same time 2nd table all field varchar update help of phone number
- → Connect PHP to IBM i (AS/400)
- → AS400 Call a stored procedure from another stored procedure
- → DB2 database special characters for insert into table
- → Equivalent of oracle function SYS_GUID() in DB2 LUW?
- → How do I create a new customer segment in Websphere Commerce using only DB2 database queries?
- → php function db2_exec not running specific DB2 queries
- → Writing and Updating DB2 tables with r