DB2 archive logs keeps on growing on my server. I don’t know why this is happening, but i resolved it by manually delete the archive history after a full backup. This is my script for deleting the history logs. Please run it as your db2inst1 user ( or whatever it’s running in ).

#!/bin/sh
array=( "blogs" "xcc" "files" "concord" "mobile" "peopledb" "dogear" "homepage" "forum" "pns" "wikis" "sncomm" "metrics" "opnact" )
current_date=date +"%Y%m"
for db in "${array[@]}"
do
db2 connect to $db
logfile=db2 get snapshot for database on $db | grep "File number of current active log" | awk {'print $8'}
logfiletemp=$(printf "%07d" $logfile)
logfile="S$logfiletemp.LOG"
db2 prune history $current_date AND DELETE
db2 prune logfile prior to $logfile
done

Visits: 222

By angioni

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.