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 > redirect restore

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-09-10, 00:52
db2cap db2cap is offline
Registered User
 
Join Date: May 2010
Posts: 87
redirect restore

Hi,
I am working on DB2 V9.1 on AIX.
Can somebody please help me in understanding the redirect restore. I read the documents but unable to help myself.
I want to restore a backup from one server to another server. Problem I am facing is, documents say that we need to create the same directory tree on the other server as we have on the first server for the backup image but when the home directories are different, how can I achieve it. I dont have root authorities so as to create the same tree structure.
For example:
path to backup on server1 is: HOME1/dbname/node0000/....
on the other server, the home directory is itself different i.e it's HOME2.
Reply With Quote
  #2 (permalink)  
Old 06-09-10, 01:50
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
If you use a redirected restore, you can redirect the tablespace containers to a different directory (and/or file name for DMS tablespaces).

You can also specify where the database is to be placed (which is the basic database info not necessarily including all the tablespaces). This information is specified in the restore commands. See the Command Reference PDF manual for details and examples.
__________________
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
  #3 (permalink)  
Old 06-09-10, 02:58
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
In Addition:

You can use the restore database command to generate a script for a redirected restore.
restore database ... redirect generate script <FILENAME> ...
Reply With Quote
  #4 (permalink)  
Old 06-09-10, 03:45
db2cap db2cap is offline
Registered User
 
Join Date: May 2010
Posts: 87
Hi Team,
Plz have a look at the steps I am performing and the place where i am getting stuck

$ pwd
/db2backup/wps01/db2wpsr2/backup
$ ls
TESTDB.0.db2wpsp1.NODE0000.CATN0000.20100608020546 .001
$ db2 restore database TESTDB to /db2/wps01/db2wpsr2/TESTDB
SQL1051N The path "/db2/wps01/db2wpsp1/testdb" does not exist.
SQLSTATE=57019

Th directory TESTDB in the restore command have been manually created in the home directory.
It is on an urgent basis i need to resolve it. Someone plz help
Reply With Quote
  #5 (permalink)  
Old 06-09-10, 05:01
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
Specifying a new directory with to is not a redirected restore! You have to use the redirect option.

db2 restore database TESTDB redirected generate script rrestore.sql
will generate you a script for the restore. You can edit it later on and start the redirected restore with it.
Reply With Quote
  #6 (permalink)  
Old 06-09-10, 07:00
stiruvee stiruvee is offline
Registered User
 
Join Date: May 2010
Location: India
Posts: 34
Hi ,

Try the following command. If you are still having problems, try generating restore script as suggested by nvk.

db2 " restore database TESTDB on /db2/wps01/db2wpsr2/TESTDB "


Satya...
Reply With Quote
  #7 (permalink)  
Old 06-09-10, 07:16
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Like nvk@vhv said: Generate the script. In that script you will recognise the path-names of your source database. Change the path-names in that script to the new path-names (you must activate the lines, they are all commented out).
On the target machine DB2 must be installed and the instance must be defined and started. You can check with the "db2 attach to instancename". This must be completed 1st.
When you run that script on the target-machine the tablespaces will be placed on the newly defined path-names and that is the trick about redirected restore
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