Purges DB2

From Tuxunix
Revision as of 10:00, 27 September 2010 by Admin (Talk | contribs) (Created page with '== clean log transaction == #!/bin/sh if [ -f /home/db2inst1/sqllib/db2profile ]; then . /home/db2inst1/sqllib/db2profile fi #extraction du nom du log de transacti…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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"