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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-23-07, 11:03
wehrle wehrle is offline
Registered User
 
Join Date: Jul 2005
Posts: 99
Restore

AIX 5.3
DB2 8.2

I am still relatively new to DB2.

When a RESTORE is performed, what dictates when to the SET TABLESPACE CONTAINERS command for a redirected restore?

I have restored a database in to an existing database, without first dropping the existing database, and I did not have to use the SET TABLESPACE CONTAINERS thing even though I thought I would since the path for the tablespaces' containers of the existing database are not DB2 default paths.

Do I have to use the SET TABLESPACE CONTAINERS command(s) to restore a database in to a NEW database so to define the desired container paths that are different than the DB2 default paths?

Are container paths include in the backup image?

Thanks,
-Gary
Reply With Quote
  #2 (permalink)  
Old 01-24-07, 04:51
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
restore

container paths are in the backup image and restore will try to restore to same paths. if it can not or if the path is in use, it will indicate it while restoring.
in that cas you have todo :
restore redirect
set container path...
restore continue
if restore to existing db only the default catalog path(not db catalog) will be used
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #3 (permalink)  
Old 01-24-07, 08:30
wehrle wehrle is offline
Registered User
 
Join Date: Jul 2005
Posts: 99
It seems to me that your last comment contradicts your first comment. I have restored to/over an existing database and it appears to me that the paths in use for containers prior to the restore are still the paths in use after the restore.
Reply With Quote
  #4 (permalink)  
Old 01-25-07, 04:32
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
paths

paths are stored in backup and reused
try
db2 list tablespace containers for 0 (and repeat for other ts)
this on source and target db and you will see
or try to restore a db that has a path, not existing on new machine and restore will fail
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #5 (permalink)  
Old 01-25-07, 08:33
wehrle wehrle is offline
Registered User
 
Join Date: Jul 2005
Posts: 99
OK, thanks, I think I am getting it.

Would it be true to say then that I would have to use the redirect and set tablespace container(s) options if I was going to restore a database in to a NEW database?
Reply With Quote
  #6 (permalink)  
Old 01-25-07, 09:45
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by wehrle
Would it be true to say then that I would have to use the redirect and set tablespace container(s) options if I was going to restore a database in to a NEW database?
Not necessarily. You will only need to do a redirected restore if either of the following is true:
- container paths specified in the backup image do not exist on the target machine (e.g. you back up a database that is on disk d: of server1 and try to restore it on server2 where there is no disk d
- container paths specified in the backup image exist on the target but are occupied by something else (e.g. other files or another database's containers)
Reply With Quote
  #7 (permalink)  
Old 01-25-07, 11:22
wehrle wehrle is offline
Registered User
 
Join Date: Jul 2005
Posts: 99
Thanks.

One last question (I think):
If I want to restore a database and retain the container paths included in the backup image, do the container paths have to already exist (and not in use by anything else) or would the restore operation create the paths if they did not already exist?
Reply With Quote
  #8 (permalink)  
Old 01-26-07, 06:22
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
restore

if it is possible to create the paths, they will be created
check authority - filesystems..
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #9 (permalink)  
Old 01-26-07, 09:01
wehrle wehrle is offline
Registered User
 
Join Date: Jul 2005
Posts: 99
Earlier, you suggested to "try to restore a db that has a path, not existing on new machine and restore will fail."

But, your last comment says the restore operation would create the paths assuming the user had the appropriate permissions to do so.

Which is true? Assuming the target instance owner user has the appropriate permissions, will the restore create the container paths within the backup image on the target system if they do not already exist or not?
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