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 > problems in restoring 1 database to anothar

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-08-03, 03:00
manish21 manish21 is offline
Registered User
 
Join Date: Jan 2003
Posts: 35
problems in restoring 1 database to anothar

I have one database db_1 at an instance db2admin on aix sever. I create anothar database db_2 at the same instance. If I want to replicate db_1 to db_2 , I have to use db2look to generated ddl statements, then have to export data to csv files for db_1 & import the same to db_2. Then I have to run the ddl script, removing code ofr freign keys & constraints. After data is imported , I have to create the constraints. Afet this I have to copy the stored procedures one by one from db2spb from 1 db to anothar. This method is cumbersome & time consuming. So I tried using restore
restore database db_1 user username using password from <backup location> taken at <timestamp> into db_2;
The aix server reponded : The container is in use
So I changed the container location of the new db and tried using restore database db_1 user username using password from <backup location> taken at <timestamp> to < container location of new db> into db_2 redirect
But the Aix server asks to load some volume.
So , Is there any way in which my entire backup of database ,table structure with all constraints can be replicated to anothar database on same or other instance easily?
Reply With Quote
  #2 (permalink)  
Old 08-08-03, 04:16
jammann jammann is offline
Registered User
 
Join Date: Jul 2003
Location: Switzerland, Basle
Posts: 10
you have to do a "redirected restore", you must set for ALL tablespace containers the new location.

example:
restore db db_1 from /db2back into db_2 redirect;
-- set container-paths for all not default tablespaces
-- DMS 1 contaner
set tablespace containers for 2 using (device '/dev/rlv_1TSTDB002_01' 16384) ;
.
.
-- DMS 2 container
set tablespace containers for 4 using (device '/dev/rlv_1TSTIN001_01' 8192,device '/dev/rlv_1TSTIN001_02' 8192) ;
.
.
-- SMS
set tablespace containers for 115 using (PATH '/insthome/db2inst1/db2inst1/afisp/TSG02') ;
-- and so on

restore db db_1 continue;
Reply With Quote
  #3 (permalink)  
Old 08-08-03, 07:42
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: problems in restoring 1 database to anothar

search for redirected restore in this forum ... You will find a lot of useful tips

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
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