Purges DB2

From Tuxunix
Jump to: navigation, search

clean log transaction

#!/bin/sh

if [ -f /home/db2inst1/sqllib/db2profile ]; then
    . /home/db2inst1/sqllib/db2profile
fi

#extraction du nom du log de transaction actif
LogFile=$(db2 get db cfg for xxxx | grep "First active log file" | awk '{print $6}';)
#connexion a la BD
db2 connect to xxx;
#suppression des anciens logs de transaction
db2 prune logfile prior to "$LogFile"