Deleting old DB2 backup

victorang

ADSM.ORG Member
Joined
Apr 10, 2003
Messages
18
Reaction score
0
Points
0
Website
Visit site
Hi,

I have DB2 backup to 2 different TSM management classes DAILY and MONTHLY. How to we use "db2adutl delete" to delete backup for each management class?
 
I can only think of writing a script to delete the specific image based on timestamp.
db2adutl delete full taken at YYYYMMDDHHmmss db dbname
 
You can script this

db2adutl delete full keep $KEEP_FULL db $DBI without prompting

Where $KEEP_FULL is the number of days worth of backups you want to keep and $DBI is the database name
 
You can script this

db2adutl delete full keep $KEEP_FULL db $DBI without prompting

Where $KEEP_FULL is the number of days worth of backups you want to keep and $DBI is the database name

But how do we delete the backup from the respective management class? Daily and Monthly management classes have different retention policies.
 
Hi,
Let me ask you a question to help you:
How do you associate your DB2 daily backup to your daily mgmt class?
The same for the monthly backup?

You can do it using different nodenames, but let us know how do you do it.

Rudy
 
Do you backup the DB2 database with something like the following command?

db2 backup db $DBI online use tsm include logs without prompting
 
Hi,
Let me ask you a question to help you:
How do you associate your DB2 daily backup to your daily mgmt class?
The same for the monthly backup?

You can do it using different nodenames, but let us know how do you do it.

Rudy

Hi,

I run the following commands during monthly backup. The default management class is DAILY. I use only 1 nodename.

db2 update db cfg for sample using TSM_MGMTCLASS MONTHLY

db2 backup db sample online use tsm

db2 update db cfg for sample using TSM_MGMTCLASS NULL
 
Well,
It seems you have a problem then.
db2adutl, the supported way to expire DB2 backups use just the time as a criteria to delete backups.

Try this:
1. db2adutl query
Save the output

2.db2 update db cfg for sample using TSM_MGMTCLASS MONTHLY
db2adutl query

Compare output from 1 to output from 2. I think they will be the same, but I am not sure. If they are the same this option will not work.

The other option is to get a list of the timestamp for each backup according to the mcclass (using db2adutl query). And them delete selectively using

db2adutl delete full taken at <timestamp>

You can write a script to parse this.

Hope this helps,
Rudy

Edit: I just realized that srikumar_1 has already suggested that in his post above.
 
Rore is right. and it all depends on what your backup and retention periods are. We have on mgmtclass and using db2atutl command delete any db2 backups that are older than 60 days.

You may also want to look at deleting the associated logs wiht the "db2adutl delete logs" command.
 
Back
Top