Results 1 to 12 of 12
  1. #1
    Join Date
    Oct 2013
    Posts
    18

    Unanswered: db2 keep database backups forever

    Hi,

    Can anyone advise if it is possible to keep a db2 backup forever/permanently without it being automatically being deleted as part of the retention policy?

    I know that with Oracle db you can use KEEP FOREVER option to achieve this (which overrides its retention policy) though so far I have not seen any evidence of this being possible to do in db2?

    Is it at all possible? I would like to be able to achieve it with disk based backups too.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Just copy it to somewhere else.

    Andy

  3. #3
    Join Date
    Oct 2013
    Posts
    18
    Hi Andy - thanks for reply, is it really that simple?

    So if I copy it to 'somewhere else' then how do I catalog it back into the history file at a later date so that it is in the library again and available for use? And will it be then a fully usable backup file that I can rely on?

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    The backup image is viable no matter where it is located. You can restore it without it being in the "History" .

    Andy

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Backups are not deleted by default, so you can leave them in the same place and just make sure they are not set to be deleted.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  6. #6
    Join Date
    Jan 2010
    Posts
    335
    Check your DB-Cfg:

    Number of database backups to retain (NUM_DB_BACKUPS) = 12
    Recovery history retention (days) (REC_HIS_RETENTN) = 366
    Auto deletion of recovery objects (AUTO_DEL_REC_OBJ) = OFF

    As said, the Backup-Images are not deleted by default. You have to do it on your own or activate the Parameter AUTO_DEL_REC_OBJ

    If you use a Tape-library to Backup your Databases, check if there's a retention-Policy and Backups are deleted by the Tape-Library.

  7. #7
    Join Date
    Oct 2013
    Posts
    18
    Thanks for all replies.

    Andy - you are spot on, we've just tested what you said & it works a treat

  8. #8
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    If AUTO_DEL_REC_OBJ is set to ON and you don't want DB2 to auto-delete some backup images/logs and don't want or can't move them somewhere else (ie. they're stored on TSM), then you can update the history file and set the status to X. See: IBM DB2 9.7 for Linux, UNIX and Windows Information Center

  9. #9
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    AT14, I am not sure what your plan is for these 'forever' backups but keep this in mind. If you go through a few upgrades, those backups may be useless. Formats (can) change with newer versions of DB2 and those old backups may not be usable in the newer Restore command.

    Backups (or Image Copies on the mainframe) are not a good choice for long term storage. Export/Unload the data and keep the DDL for this purpose.

  10. #10
    Join Date
    Oct 2013
    Posts
    18
    they are not for upgrades etc...though I thought that we could restore backups to newer versions as on 10.1.

    We are undertaking some data loading work and would like the option to be able to restore the db to the point before the loading commenced if necessary so thought db backups ideal.

  11. #11
    Join Date
    Jan 2010
    Posts
    335
    Hi,

    yes, you can restore from a 9.7 Backup to a Version 10.1.
    But you can't restore a ten year old 7.2 Backup to 10.1.

    That is what Stealth_DBA meant. If you have to archive Data for 10 years or even longer, then a Backup is not a good choice.

  12. #12
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You also need to know that restoring an older version to a newer version via backup/restore (e.g. 9.7 to 10.1) your backups have to be offline backups.

    Andy

Posting Permissions

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