Generate command list for all instance’s Dbs

-) Step 1 : this scrip is an example to prune all logs and backup of a db.

#################### prune.sh
db2 connect to $1
db2 PRUNE HISTORY 20131007 AND DELETE

 

-) Step 2 : generate a command list to prune object for all Dbs in the instance

db2 list database directory | grep alias | awk ‘{print “./prune.sh ” $4}’ > cmdlist

Leave a Reply

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

Antispam Question * Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.