Solved

db2 restore db in a separate server in DB2 8.1.5 in AIX 5.1

Posted on 2004-10-08
3
1,901 Views
Last Modified: 2012-05-05
Hi experts,

My env is:  DB2 8.1.5 in AIX 5.1 system and on connecting to database we can see:
Database Connection Information...

Database server        = DB2/6000 8.1.5
 SQL authorization ID   = DB2INST1
 Local database alias   = xxxxx

I have a full backup from Server A, but I need to restore the it on Server B to create a testdb with the same

name.  When I try to do a restore,
by: db2 restore db xxxxx from xxxxx.0.db2inst1.NODE0000.CATN0000.20040910133320.001
I get the error:  SQL2036N  The path for the file or device
"xxxxx.0.db2inst1.NODE0000.CATN0000.20040910133320.001" is not valid.

I know the bkup exists because I FTP'ed it from prod to test.  verified by listing it in test.  How do I

recover successfully to create a testdb in the target server? Same name of db, instance, and every thing else.

Do I need to drop the exiting database befor doing the recover?  Quickly need to fix this.  Any help will be appreciated.
0
Comment
Question by:dbruk
  • 2
3 Comments
 
LVL 13

Expert Comment

by:ghp7000
ID: 12262019
Do you have exactly the same path set up in server B as that in server A? Or did you upload only the .001 file?
Are you sure that in server B the node is set to 0?
Have you tried starting the restore from directory xxxx.0? In that case, your command would simply be restore db db_name
You do not need to drop the existing database, you will be prompted to overwrite the existing database once the restore starts


0
 

Author Comment

by:dbruk
ID: 12262715
Thanks ghp7000.  Answers to your questions:
Do you have exactly the same path set up in server B as that in server A?  No.
Database created on:
A's path(source): /AXXXXX/db2inst1/db2inst1/NODE0000/SQL00003/  ... ETC.
Database created on:
B's path(target): /AXXXXX/db2inst1/NODE0000/SQL00003/  ... ETC.
(note: db2inst1 appears twice in A.  Is that an issue? Can change it, if required.)
 Or did you upload only the .001 file?  Y.
Are you sure that in server B the node is set to 0? Y.
Have you tried starting the restore from directory xxxx.0? N.  My command was exactly as below:
db2 restore db xxxxx from xxxxx.0.db2inst1.NODE0000.CATN0000.20040910133320.001
(xxxxx.0.db2inst1.NODE0000.CATN0000.20040910133320.001 was a good full backup of A
That was FTP'ed successfully from source to target.)
In that case, your command would simply be: restore db db_name
Did try that. Got err msg: SQL2522N  More than one backup file matches the timestamp value provided for
the backed up database image.

Look forward to hearing from experts.  Thanks.
0
 
LVL 13

Accepted Solution

by:
ghp7000 earned 125 total points
ID: 12265063
yes, thats your problem, in order for the restore to work, you have to have the restore image (that means the001 file) in the same path as on the source server.
Example:
Server A has a backup image stored at xxxxx.0.db2inst1.NODE0000.CATN0000.20040910133320.001
Server B must have the same image in the same path.
If server B already has path name xxxxx.0.db2inst1.NODE0000.CATN0000 with another 001 file in it, then you have two different backup images that you can use to restore the database. In that case, your command would be:
db2 restore db <db_name> taken at 20040910133320
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Using select statement from input file with DB2 EXPORT 1 558
RPG to c# 3 376
How do identify a "break in coveage" 8 186
determine create date for a DB2 LUW Table 4 171
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question