If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Database backup and restore

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-14-04, 09:34
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
Database backup and restore

Version info - Source
UDB Version 7 on windows server

Version info - Destination
UDB Version 8.1 Personal edition

I took a backup of the database from the source and copied the file and was trying to restore in the destination but I am unable to proceed. It keeps on complaining about time stamp. I want to FORCE (see notes 2) restore the database

Some notes
1. I want to create a database in the destination which will be a image of the source
2. In SQL server there is something like FORCED RESTORE meaning do not check any timestamp or anthing -- just restore without any checks. Does DB2 has something like this....

Please let me know the best way to do this. Thanks
__________________

You are the creator of your own destiny!
Reply With Quote
  #2 (permalink)  
Old 08-14-04, 10:51
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
On DB2 for Windows you need to re-create the entire directory structure of the original backup file on the new server.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 08-14-04, 12:09
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
Marcus_A,

Quote:
On DB2 for Windows you need to re-create the entire directory structure of the original backup file on the new server.
Well...this is what I did:

1. Backed up to some folder like c:/db2/backup/node0000/...... 110255.001 file from source server

2. Restored the same directory structure in the destination and when restored requested that the file be picked up from this place

Is there anything else I should do????
__________________

You are the creator of your own destiny!
Reply With Quote
  #4 (permalink)  
Old 08-14-04, 15:01
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
First run the db2ckbkp against the backup file to get the timestamp of the backup file. See the Command Reference for details.

Once you have the timestamp, here is an example backup command for the following directory:

E:\Backup\DB2\SAMPLE.0\DB2\NODE0000\CATN0000 (location of backup)

RESTORE DATABASE SAMPLE FROM E:\\DB2\\Backup TAKEN AT 20040318144754 WITH 2 BUFFERS BUFFER 1024 WITHOUT PROMPTING

where 20040318144754 is the timestamp obtained from the db2ckbkp program.

When you backup and restore using the Control Center, you can see the commands that are generated by the "Show SQL" option, even if you don't submit the script via the Control Center.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 08-14-04, 21:50
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
Marcus_A,

I get the following message for the command DB2CKBKP -A 20040806

Quote:
DB2CKBKP ERROR: Opening file 20040806. Access denied.
RC: -2079391743 [x840F0001] in ../tool/db2ckbkp.C at line 337
Any help would be much appreciated
__________________

You are the creator of your own destiny!
Reply With Quote
  #6 (permalink)  
Old 08-14-04, 21:53
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I thought your file name was 110255.001 ?

This sounds like a Windows file permission problem.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #7 (permalink)  
Old 08-14-04, 22:01
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
Marcus_A,

Sorry I goofed up! That was a directory not the file! Working fine. Now trying to restore. Hopefully it works :-)
__________________

You are the creator of your own destiny!
Reply With Quote
  #8 (permalink)  
Old 08-14-04, 22:14
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
Success! Thanks a lot!

Just one question. Does the restored database need to exist to start with when I issue the restore command?
__________________

You are the creator of your own destiny!
Reply With Quote
  #9 (permalink)  
Old 08-14-04, 22:22
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
The restore utility can restore to a database with a name different from the database name in the backup image (in addition to being able to restore to a new database).

You can download the Command Reference manual in PDF format from this site:
http://www-306.ibm.com/software/data...manualsv8.html
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #10 (permalink)  
Old 08-14-04, 22:24
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
Smile

Marcus_A,

Thanks a lot! I do have the manual - Let me read it!

This thread is now closed
__________________

You are the creator of your own destiny!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On