Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring the db to a new db

Status
Not open for further replies.

gbag

IS-IT--Management
Oct 19, 2003
47
US
Hi,
I need some help in restoring the db.
I have db [samp] on one system. I have taken the offline backup of that. Now I want to restore it onto another system with the name as sample.
The two systems are are similar. Can anybody tell me the exact command to do this.
When I tried to restore with
db2 restore db sample from /u/bkp
This I did after renaming the backed up file.
It always complains as 'The image was created fro database alias "". The error number is SQL2069N.
I don't want to use db2move or any other utility except restore command.
Any help is highly appreciated.
Thanks
Gbag.
 
My experience is that when restoring a database backup to a new database DB2 expects the path to be EXACTLY the same on both servers. If not exactly the same the image is not accepted as a valid backup. Do not ask me why, it is just an experience....

T. Blom
Information analyst
tbl@shimano-eu.com
 
If the database is a 'different shape' to the original, in terms of file placement, tablespaces etc it is necessary to do a re-directed restore.

This should work but it takes an age.
 
Hi,

Following is the commnad:
ex: Backup image file is: sample.0.inst1.20040212102032.000

db2 restore db sample from <backup image path> taken at 20040212102032 to <destination path> without rolling forward

Note:Make sure DB2CODEPAGE of Destination is same the source db server

This is as simple as that:
 
hi,
you have told that both the systems are similar. r u sure?


 
I am considering both the cases.
One with similar systems and another case with Linux to Windows. Right now we are doing for the second case, a db2move turning off the logging.
Thanks
 
I used to move prod to dev once a week and always ran:

db2 restore database prod from file into dev buffer 256 replace existing without datalink.

I had to update that a little bit because we went from SMS to DMS....

db2 "restore database prd from file into dev buffer 256 replace existing redirect without prompting"

sleep 5

db2 "set tablespace containers for 3 using (file '/db2cat/dev/data01.f01' 5000000)"
db2 "set tablespace containers for 4 using (file '/db2cat/dev/index01.f01' 5500000)"

sleep 5

db2 "restore database prd continue"

This was a online backup, so I copied over the logs to dev and finished with a "db2 rollforward db dev to end of logs stop"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top