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 > Restoring DB Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-26-07, 16:10
chemaster chemaster is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
Restoring DB Error

Windows DB2

DB2 Backup Location: c:\DB2_PrimaryBackup
DB2 Backup Physical Locations:
c:\DB2_PrimaryBackup\myDB.0\DB2\Node0001\Catn0000\ 20070201
c:\DB2_PrimaryBackup\myDB.0\DB2\Node0001\Catn0000\ 20070202
c:\DB2_PrimaryBackup\myDB.0\DB2\Node0001\Catn0000\ 20070203

I am attempting to restore a database but get the following errors:

Using:
db2 restore database myDB user chemaster using mypassword from c:\DB2_PrimaryBackup

Error:
More than one backup file matches the timestamp value provided for the backuped up database image.

Using:
db2 restore database myDB user chemaster using mypassword from c:\DB2_PrimaryBackup\myDB.0\DB2\Node0001\Catn0000\ 20070201

or taking off any subdirectory from 20070201 back

Error:
No match for a database image file was found based on the source database alias "myDB" and timestamp ""

Thanks in advance for you help!

Last edited by chemaster; 02-26-07 at 16:16.
Reply With Quote
  #2 (permalink)  
Old 02-26-07, 16:16
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Look in the Command Reference for the Restore Command. Your command should look like:

restore db MyDB from c:\db2_primarybackup taken at 20070201010003 [more stuff goes here depending on what you want to do]

Andy
Reply With Quote
  #3 (permalink)  
Old 02-27-07, 20:35
chemaster chemaster is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
This didn't work:
restore db MyDB from c:\db2_primarybackup taken at 20070201010003

However, this seemed to work perfect:
restore db MyDB from c:\db2_primarybackup taken at 20070201

Is there a downside or possible problems associated with it on a Windows 2000 system?

I'm sorry if this sounds like a stupid question but sometimes assuming something may be quite dangerous.

Last edited by chemaster; 02-27-07 at 21:38.
Reply With Quote
  #4 (permalink)  
Old 02-28-07, 08:02
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I have not used DB2 on Windows, so I am no expert there. This might help:

http://www-128.ibm.com/developerwork...2mccluney.html

Andy
Reply With Quote
  #5 (permalink)  
Old 02-28-07, 08:46
chemaster chemaster is offline
Registered User
 
Join Date: Feb 2006
Posts: 13
I'm slow but think that it has been figured out.

The following didn't work because the 010003 timestamp was wrong
restore db MyDB from c:\db2_primarybackup taken at 20070201010003

The following worked because I only has one file backed up for the day in question.
restore db MyDB from c:\db2_primarybackup taken at 20070201

However, looking at the file itself provided me with the correct timestamp so the following also works.
restore db MyDB from c:\db2_primarybackup taken at 20070201231503

Thank you very much for the help!!!
Reply With Quote
  #6 (permalink)  
Old 02-28-07, 10:17
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
In such cases by running db2ckbkup -h filename

where filename is the backup filename, you get the correct path and time to use for restore.
__________________
mota
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