Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2009
    Posts
    4

    Unanswered: table space restore

    Can I restore tablespaces from a cold backup?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    "Cold backup" is not a standard DB2 term, so, assuming that you meant offline backup, the answer should be "yes". However, I think you will still need to roll forward the database, which requires it be in archive logging mode and the logs being available.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Dec 2009
    Posts
    4
    How can I tell if backup is offline and if archival logging mode is set?

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    That generally depends on what DB2 version you use. You may also want to describe your situation in greater detail to avoid guesswork.
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    Dec 2009
    Posts
    4
    I'm told we are running DB2 9.5.2. I need to restore several tablespaces from the image. I don't know if the image is offline and logging mode. How to check?

  6. #6
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    You can use the db2ckbkp command to check if your image is offline or online. If you're restoring a set of tablespaces into a different db (different from the one this backup image was created from), then you have to use the rebuild option on the restore command. If you're restoring a set of tablespaces into the same database, then db has be enabled for archival logging (as Nick had mentioned). The restored tablespaces will be in the rollforward pending state and you need to have the logs in order to rollforward them.


    I think you're restoring into a different db/env, so you'll need to use the rebuild option. I did a quick test to show how this is done. See if this is something you can use (play with it in some test env first). I'm attaching it here.
    Attached Files Attached Files

  7. #7
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    In my example, I used a non-automatic storage tablespace (testts). If I create testts using automatic storage, then the restore command will be different:

    bkogan@p6db2serv /home/bkogan/TEST > db2 "restore db test rebuild with tablespace (syscatspace, testts) on /home/bkogan/testts2 into test2"
    DB20000I The RESTORE DATABASE command completed successfully.

Posting Permissions

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