Thanks for your response, its certailnly very helpful.
When I mentioned that we are deleting the contents of archived logs directory after copying the logs to tape, I meant the directory where the logs are directed to as a result of user exit program that we are already using. We are not deleting anything from the active logs directory.
I should have made it more clear. Sorry about that.
Please let me know if you know of any harmful impacts of deleting even these logs (sent to the mylogs folder by user exit program).
Thanks for your idea of generating a list of files copied and deleting only those. I'll look more into it and hopefully I'll find something in the Administrative API of C.
Quote:
Originally posted by cchattoraj
I do not think it is a good idea to delete anything directly from the archive log directory, the reason being that db2 reuses logs, holds on to logs while a transaction is active, changes log sequence under certain circumstances and there are certain configuration parms which affect what db2 expects to find in the directory at certain times. Therefore it is difficult to determine which logs are active at a point in time. And as DBAs, I'm sure we all struggle to determine what to do. I would think that you could modify the userexit program under $insthome/sqllib/samples/c and make db2 archive logs to (other) disk. Then it should be safer to copy these logs from other disk, because now you are aware that they are truly archived and not active. About deleting, I'm sure that there is manner in which you can delete only those files which are copied - maybe generate a lock file with a list of files which will be copied and delete those files only. This will prevent loss of archive logs. Archive logs are very important where online backups are concerned. It is actually a good idea to be extremely cautious about deleting archive logs.
As far as handling this we use shell scripts, however, I am sure you could code this into any language using Administrative API calls. Look up the Administrative API reference.
Hope this helps.
|