Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2014-02-13T20:35:59Z by LukeNumrych
John2006
John2006
1 Post
ACCEPTED ANSWER

Pinned topic Db2 9.5 delete old DB backup image

‏2014-02-09T15:46:52Z |

Hi brother,

we would like to delete old backup image on locate disk, can I use unix command to delete directly like 'rm' or I need connect to db2 then use SQL command to delete the old db backup image?

thank

john

  • Kelly Rodger
    Kelly Rodger
    7 Posts
    ACCEPTED ANSWER

    Re: Db2 9.5 delete old DB backup image

    ‏2014-02-12T06:15:03Z  in response to John2006

    John, you can delete DB2 backup images directly yourself if they're on local filesystems.  That's not usually a problem, unless the image is part of a set of incremental or delta images, in which case proceed with great caution.  If there's ever a chance that you'll use any of the automated recovery capabilities, such as the RECOVER command, a RESTORE REBUILD, or an automatic incremental restore, as a few examples, then it's a good idea to also update the database history records of those backup images to mark the images as deleted.

    UPDATE HISTORY FOR 20140212010900001 WITH STATUS D

    Better yet, have you looked at the AUTO_DEL_REC_OBJ database configuration parameter, which can automatically clean up old images for you based on retention settings that you specify, so you don't have to worry about any of this.

    Hope that helps

    Kelly Rodger

  • LukeNumrych
    LukeNumrych
    88 Posts
    ACCEPTED ANSWER

    Re: Db2 9.5 delete old DB backup image

    ‏2014-02-13T20:35:59Z  in response to John2006

    I like to use PRUNE HISTORY AND DELETE in conjunction with AUTO_DEL_REC_OBJ in these instances where I have to manually remove backup files.  The goal though is to let DB2 manage pruning of recovery objects (backup and log files).  See auto_del_rec_obj, num_db_backups, and rec_hist_retentn.