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 > Backup and restore database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-08, 07:10
SilencerandLois SilencerandLois is offline
Registered User
 
Join Date: Feb 2008
Posts: 25
Backup and restore database

Hi!
I did a backup of my database "Test" with the following command
Code:
db2 backup database test to c:\
The Command created a backup of the database called "test.0.db2......".

Now, i wanted to restore the backup on another computer (same db2-distribution) with command:
Code:
db2 restore database test from test.0.db2....
But I get the error message (the message is translated from german to english)
Code:
SQL2036N: Path of data file test.0.db2.... not valid
What am I doing wrong?

Regards,
Martin
Reply With Quote
  #2 (permalink)  
Old 07-18-08, 08:12
nick.ncs nick.ncs is offline
Registered User
 
Join Date: May 2007
Location: somewhere in dbforums
Posts: 221
when you do restore in your new computer type in the full path to the file.... basically the restore command is unable to find your backup file

so your command will be something like
db2 restore database test from full path of the backup file

e.g if my backup file (ABC) is in C:/backup then your command will be
db2 restore database test from c:/backup/ABC
Reply With Quote
  #3 (permalink)  
Old 07-18-08, 08:16
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by nick.ncs
when you do restore in your new computer type in the full path to the file.... basically the restore command is unable to find your backup file

so your command will be something like
db2 restore database test from full path of the backup file

e.g if my backup file (ABC) is in C:/backup then your command will be
db2 restore database test from c:/backup/ABC
This is incorrect. Given the command
Code:
db2 backup database test to c:\
the restore command should look like
Code:
db2 restore database test from c:\
Reply With Quote
  #4 (permalink)  
Old 07-18-08, 08:19
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
With WIndows on version 8, you do not specify the full path. Not sure which version you are using. Also, you need to mention the path (FROM clause) and timestamp (TAKEN AT clause) of the backup file, not the file name.

Your best bet is to do a backup and restore using the Control Center and do a "show SQL" to see what the syntax is for the restore.
__________________
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 07-19-08, 06:04
SilencerandLois SilencerandLois is offline
Registered User
 
Join Date: Feb 2008
Posts: 25
Hi!
Thanks for you replies!
The correct command was
Code:
db2 restore database test from c:\
Regards,
Martin
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