Results 1 to 9 of 9

Thread: Restore

  1. #1
    Join Date
    Jul 2005
    Posts
    103

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

  2. #2
    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

  3. #3
    Join Date
    Jul 2005
    Posts
    103
    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.

  4. #4
    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

  5. #5
    Join Date
    Jul 2005
    Posts
    103
    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?

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    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)
    ---
    "It does not work" is not a valid problem statement.

  7. #7
    Join Date
    Jul 2005
    Posts
    103
    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?

  8. #8
    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

  9. #9
    Join Date
    Jul 2005
    Posts
    103
    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?

Posting Permissions

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