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 > Restore to location using DB Links

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-19-10, 14:32
jodie jodie is offline
Registered User
 
Join Date: Aug 2003
Location: Ohio
Posts: 38
Question Restore to location using DB Links

Hi!
I am having a problem when I restore a database to a location that is a symbolic link. It appears DB2 is translating the symbolic link, and storing the container names using the "real" path. This is a problem because the plan is to mount this area in the location of the symbolic link in case of a disaster at the primary location.

For example:
The data location is /law/prod/db2_data/db2inst1. The symbolic link is /db2_data/db2inst1 points to /law/prod/db2_data/db2inst1.
Code:
ll /db2_data
lrwxr-xr-x   1 db2inst1 db2inst1         32 Mar 18 15:24 db2inst1 -> /law/prod/db2_data/db2inst1
In case of a disaster, the /law/prod/db2_data/db2inst1 will be mounted as /db2_data/db2inst1.

So my restore command is:
Code:
db2 "restore db db2inst1 to /db2_data/db2inst1 into db2inst1"
But when I query the containers, the whole path is listed:
Code:
TBSPC_NAME   CONT_NAME                                                                    CONTAINER_TYPE USABLE_PAGES
------------ ---------------------------------------------------------------------------- -------------- ------------
SYSCATSPACE  /law/prod/db2_data/db2inst1/db2inst1/NODE0000/SQL00001/SQLT0000.0            SMS Directory             0
TEMPSPACE1   /law/prod/db2_data/db2inst1/db2inst1/NODE0000/SQL00001/SQLT0001.0            SMS Directory             0
USERSPACE1   /law/prod/db2_data/db2inst1/db2inst1/NODE0000/SQL00001/SQLT0002.0            SMS Directory             0
SYSTOOLSPACE /law/prod/db2_data/db2inst1/db2inst1/NODE0000/SQL00001/SYSTOOLSPACE          DMS File               8188
SYSTOOLSTMPS /law/prod/db2_data/db2inst1/db2inst1/NODE0000/SQL00001/SYSTOOLSTMPSPACE      SMS Directory             0
Is there anyway to force it to not translate the links?

Thanks!
Jodie
Reply With Quote
  #2 (permalink)  
Old 03-19-10, 14:40
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 3,283
RESTORE ... TO indicates the database path, which is different from tablespace container paths. During the restore DB2 attempts to create containers in their original locations, unless REDIRECT is specified, in which case you will have to set each container path to a desired location. Look for "redirected restore" in the manuals for more information.
Reply With Quote
  #3 (permalink)  
Old 03-19-10, 14:47
jodie jodie is offline
Registered User
 
Join Date: Aug 2003
Location: Ohio
Posts: 38
n_i,
I can't use redirected restore.. this is a restore for an HADR database (will be anyway.. just testing out the restore right now). I don't believe you can use redirected restore with HADR.

Any other ideas?

Thanks!
Jodie
Reply With Quote
  #4 (permalink)  
Old 03-19-10, 15:23
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 3,283
Well, you are attempting to place tablespace containers into directories that differ from those on the primary - how's that different from redirected restore?

Like I said, RESTORE tries to re-create tablespace containers in the paths that are saved in the backup image, unless you use REDIRECT. If the paths are not available the restore will fail.
Reply With Quote
Reply

Thread Tools
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