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 db2 database.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-16-10, 08:20
Vish_1x1 Vish_1x1 is offline
Registered User
 
Join Date: Aug 2010
Posts: 8
restoring db2 database.

Hello All,

I have got a database backup with name as below....

"EHA0710.0.db2inst1.NODE0000.CATN0000.201008101504 36.001"

This I want to restore to my database EHA0710, which I have created
myself using DB2 express c "control center".

But when I try to restore It by right clicking on the database and then restore
option It says that.....

"SQL2532N The backup file contains the backup image of database
"EHA0710" taken at timestamp "20100810150436". This is not the
backup image requested."

What should I do ? I need this database badly.

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 08-16-10, 09:10
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I have several questions:

1) What DB2 version and OS are you using?
2) Where did the backup image come from? Was it the same database you are trying to restore into? Did it come from the same server?
3) What is the restore command you are trying to use to restore the database?

Andy
Reply With Quote
  #3 (permalink)  
Old 08-16-10, 10:14
wilsonfv wilsonfv is offline
Registered User
 
Join Date: Apr 2009
Posts: 42
do you enter a wrong timestamp in the control centre when control centre is trying to look for the image ? 20100810150436 is what you should enter
Reply With Quote
  #4 (permalink)  
Old 08-16-10, 22:46
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Some additional things you can try:

- drop db you created yourself and retry the restore (from the command line)
- if you transferred this image from another server, make sure it was done using binary mode (you can use db2ckbkp to verify that the image is good)
Reply With Quote
  #5 (permalink)  
Old 08-16-10, 23:06
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Code:
>db2 drop db EHA0710
DB20000I  The DROP DATABASE command completed successfully.
>db2 restore db EHA0710 
DB20000I  The RESTORE DATABASE command completed successfully.
OR

Code:
>db2 restore db EHA0710 replace existing
SQL2539W  Warning!  Restoring to an existing database that is the same as the backup image database.  The database files will be deleted.
Reply With Quote
  #6 (permalink)  
Old 08-17-10, 01:01
Vish_1x1 Vish_1x1 is offline
Registered User
 
Join Date: Aug 2010
Posts: 8
Quote:
Originally Posted by ARWinner View Post
I have several questions:

1) What DB2 version and OS are you using?
2) Where did the backup image come from? Was it the same database you are trying to restore into? Did it come from the same server?
3) What is the restore command you are trying to use to restore the database?

Andy
1) Version DB2 v9.7.200.358

2) The backup image came from clients production environment
which their previous vendors had set up for them. ( may be from their
server.)

3) I am not trying any restore command. I am using the db2 express c
to restore the database and It gives a command before restoring, that
is as follows.

********
RESTORE DATABASE EHA0710 FROM "C:\DB2" TAKEN AT 20100816171950 WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT ROLLING FORWARD WITHOUT PROMPTING;
********

I am not sure what db2 version the previous vendor was using.
Reply With Quote
  #7 (permalink)  
Old 08-17-10, 01:05
Vish_1x1 Vish_1x1 is offline
Registered User
 
Join Date: Aug 2010
Posts: 8
Quote:
Originally Posted by wilsonfv View Post
do you enter a wrong timestamp in the control centre when control centre is trying to look for the image ? 20100810150436 is what you should enter
when I try to restore the database through db2 express c tool.
I provide it with the image name and the timestamp that is mentioned in
the image provided by the client. (which may be different from the database on which I try to restore. I try to restore clients image on the database I created myself.)
Reply With Quote
  #8 (permalink)  
Old 08-17-10, 01:06
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Quote:
Originally Posted by Vish_1x1 View Post
1)
3) I am not trying any restore command. I am using the db2 express c
to restore the database and It gives a command before restoring, that
is as follows.

********
RESTORE DATABASE EHA0710 FROM "C:\DB2" TAKEN AT 20100816171950 WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT ROLLING FORWARD WITHOUT PROMPTING;
********
Definitely, you are trying to restore the database. No matter it is GUI or commnad line.

This should work in any case because the image seems to be an offline backup image ( I am not sure if image comes from ver 5 or v6 ).

Regards
Reply With Quote
  #9 (permalink)  
Old 08-17-10, 01:19
Vish_1x1 Vish_1x1 is offline
Registered User
 
Join Date: Aug 2010
Posts: 8
Quote:
Originally Posted by DBFinder View Post
Code:
>db2 drop db EHA0710
DB20000I  The DROP DATABASE command completed successfully.
>db2 restore db EHA0710 
DB20000I  The RESTORE DATABASE command completed successfully.
OR

Code:
>db2 restore db EHA0710 replace existing
SQL2539W  Warning!  Restoring to an existing database that is the same as the backup image database.  The database files will be deleted.
Thanks Every one for your valuable feedback.

If I have the image file as below

EHA0710.0.db2inst1.NODE0000.CATN0000.2010081015043 6.001

what would be the restore command for that.

I tried the restore command as specidied by you "db2 restore db EHA0710"
but it says
**********
SQL2542N No match for a database image file was found based on the source
database alias "EHA0710" and timestamp "" provided.
**********
Reply With Quote
  #10 (permalink)  
Old 08-17-10, 01:26
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Quote:
Originally Posted by Vish_1x1 View Post
Thanks Every one for your valuable feedback.

If I have the image file as below

EHA0710.0.db2inst1.NODE0000.CATN0000.2010081015043 6.001

what would be the restore command for that.

I tried the restore command as specidied by you "db2 restore db EHA0710"
but it says
**********
SQL2542N No match for a database image file was found based on the source
database alias "EHA0710" and timestamp "" provided.
**********
The one you pasted already. The simplest version will be as I said

Code:
db2 restore db EHA0710
when you are in the same folder as image.


or

Code:
db2 restore db EHA0710 from C:/DB2
from anywhere.


regards
Reply With Quote
  #11 (permalink)  
Old 08-17-10, 01:31
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Seems that the image was created on Linux platform. You may have to restore it on Linux box, then export data or db2relocate or db2move, in fact I am not sure at this moment.

I will find out more for you.

regards
Reply With Quote
  #12 (permalink)  
Old 08-17-10, 01:35
Vish_1x1 Vish_1x1 is offline
Registered User
 
Join Date: Aug 2010
Posts: 8
Quote:
Originally Posted by DBFinder View Post
The one you pasted already. The simplest version will be as I said

Code:
db2 restore db EHA0710
when you are in the same folder as image.


or

Code:
db2 restore db EHA0710 from C:/DB2
from anywhere.


regards
Thanks so much for immediate reply.
I just tried out as you said

db2 => restore db EHA0710 from C:\DB2

This was the out come......
*************************
SQL2570N An attempt to restore on target OS "NT-32" from a backup created on
source OS "Linux-IA32" failed due to the incompatibility of operating systems
or an incorrect specification of the restore command. Reason-code: "1".
*************************

I am using windows 7.....
Reply With Quote
  #13 (permalink)  
Old 08-17-10, 01:39
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Better,

I had indicated that. Now you are almost clear.

Only way can be to restore it on similar system and move it via some utility or native db2 commands. I have never done that; but there are many experts on this forum to help out.

regards
Reply With Quote
  #14 (permalink)  
Old 08-17-10, 01:46
Vish_1x1 Vish_1x1 is offline
Registered User
 
Join Date: Aug 2010
Posts: 8
Quote:
Originally Posted by DBFinder View Post
Better,

I had indicated that. Now you are almost clear.

Only way can be to restore it on similar system and move it via some utility or native db2 commands. I have never done that; but there are many experts on this forum to help out.

regards

Thank you so much for the help. I will try to restore it on linux platform and
then move it to some other server. Will keep the tread updated with all my progress and findings ......

Thanks ALL .
Reply With Quote
  #15 (permalink)  
Old 08-17-10, 03:08
Vish_1x1 Vish_1x1 is offline
Registered User
 
Join Date: Aug 2010
Posts: 8
Hello All,

Any latest version of db2ecpress installer on linux can help me restore the database on linux. am I right?

or do I need to get any specific varsion of db2 to restore my image file.
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