Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003

    Unanswered: 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?

  2. #2
    Join Date
    Jul 2003
    Switzerland, Basle
    you have to do a "redirected restore", you must set for ALL tablespace containers the new location.

    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;

  3. #3
    Join Date
    Aug 2001

    Re: problems in restoring 1 database to anothar

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

    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts