Results 1 to 9 of 9

Thread: Restore Problem

  1. #1
    Join Date
    Jul 2005
    Posts
    31

    Unanswered: Restore Problem

    I am attempting to restore from a backup of one database to another database. I used the following:
    db2 restore database prod user .... using .... taken at 20080227132810 into test replace existing without rolling forward
    I get the following error:
    SQL0294N The container is already in use. SQLSTATE=42730

    I am sure it is something stupid that I am doing. Thank you.

  2. #2
    Join Date
    Jun 2006
    Posts
    471
    or there is another db using the container path and redirected restore is needed
    or just drop the db test and restore the other db, because of the layout I presume
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Jul 2005
    Posts
    31
    Hi guyprzytula,
    Thank you for your response. I probably should have given more information. What I am attempting to do is restore the database TEST from a backup taken of the database PROD. What would be the correct syntax of the restore command to accomplish this? The TEST database is or should be the same as PROD. I am using DB2 version 8.1.1.56 fixpack 6.
    Last edited by jyoung; 03-03-08 at 08:12.

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The naming of the databases is pretty much irrelevant here. The problem you have is that the database to be restored refers to the same physical file as some other database residing on the same system. Since a single file can only be used by one database, DB2 won't let you override an existing file with the files from the database to be restored. So you have to do a "redirected restore" - as Guy explained - in order to redirect the file names in the backup image to new file names for the restored database.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Jul 2005
    Posts
    31
    Hi stolze,
    Thank you for your response. I will check my documentation on how to perform a "redirected restore" and see what happens.

  6. #6
    Join Date
    Jul 2005
    Posts
    31
    Ok, I have dropped the TEST database. Now I want to restore the backup of the PROD database to TEST and I want to make sure that the containers go into a specific directory. For the data portion I want them in /db2test/data. For the index portion /db2test/index. What would be the restore command for that? Thank you.

  7. #7
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by jyoung
    Ok, I have dropped the TEST database. Now I want to restore the backup of the PROD database to TEST and I want to make sure that the containers go into a specific directory. For the data portion I want them in /db2test/data. For the index portion /db2test/index. What would be the restore command for that? Thank you.
    During a restore operation, you can rellocate a particular tablespace, but you cannot rellocate a table (or indexes within a table) unless the data and indexes are already pointed to different tablespaces.

    You could change the schema definition to point the tables and indexes to different locations and then reload all the data with a db2move.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  8. #8
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Quote Originally Posted by jyoung
    Ok, I have dropped the TEST database. Now I want to restore the backup of the PROD database to TEST and I want to make sure that the containers go into a specific directory. For the data portion I want them in /db2test/data. For the index portion /db2test/index. What would be the restore command for that?
    Have a look at the Command Reference. It explains in detail how to invoke a redirected restore, to do the actual redirection, and then how to continue the restore.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  9. #9
    Join Date
    Jul 2005
    Posts
    31
    Thank you both for your responses. I will take a look at the command reference.

Posting Permissions

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