Search code examples
db2db2-luw

db2 prune history timestamp and delete having no effect?


I need your help with this one: I'm on db2 luw 10.5.8 and have set logarchmeth1 to tsm. I noticed my logpath is getting full (only 10% of available space left) and so I decided to use the db2 prune history command to free up some space.

Here is the command I used:

db2 prune history 20170813 and delete

I was under the impression that this command would free up some space by deleting all logfiles prior or equal to the specified date. Unfortunatley it didn't work that way. The available free space in my logpath remained unchanged at 10%.

I also tried the depracated prune logfile command (same result):

db2 prune logfile prior to S0000100.LOG

What can I do to free up some space in my logpath? Any ideas?


Solution

  • Did you verify that the archival to TSM is completing successfully? Also you may need to manually archive any log files that completed before you switched on TSM.

    You can see this tsm-archival-completion in the db2diag and the db_history view. If you set AUTO_DEL_REC_OBJ to on, then DB2 should do the prune for you at the end of a DB2-backup according to related settings.

    If there is a TSM outage, the log files to be archived will stay in the active-log path (unless you additionally define FAILARCHPATH) until either the filesystem for active-logs fills or TSM-resumes-service (whichever happens first). DB2 will continually retry TSM and auto resume archival when TSM responds.

    Ensure your filesystem for active-logs (and/or failarchpath filesystem) are large enough to tolerate a TSM-outage of your chosen duration.