Unanswered: way to decide which log file is required
If you keep more than one backup ,how is it decided that which logs needs to be kept for restore ?
We know that to find last log but interested in finding for restore requirement of log files for rollforward.
This is at restore,we want to know well in advance
I think it does not answer my question.
The way you said is reactive.
It means we will know only at time we restore database.what we want to do is that keep more than 2 backups taken at diffrent interval ( for now say it is normal ,not delta or incremental but online bkups ) ,so log files will grow accordingly.
Now if you need to restore db with back up other than last back up and if it needs logs which we have removed than it will not be able to restore that database as it is missing the necessory log files.To avoid this situation and be proactive we want to determine that for example,
let us say we backed up db at time 't1' and backup is 'b1' and than next day backed up at 'time 't2' and backup 'b2' and than 't3' and backup file is 'b3'
now from time 't1' through 't3' there are certain log files ( database log files) creatd whether is online archive and offline archive files and active log files.
so to restore database with backup 'b1' taken at time 't1' once it needs required log files---> this is what we want to know proactively as we want to make sure to keep this log files.
DB2 keeps track of which logs are needed for a particular backup. DB2 uses a user exit routine to archive logs to an extenal media (Like TSM). Logs do not need to be deleted due to this. As you know, it is not recommended to ever delete any logs due to the fact that your db becomes unrecoverable when log files are deleted.