Solved

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

Posted on 2004-10-08
3
1,876 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
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…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now