Page 1 of 1

Deleting logs of multiple jobs simultaneously

Posted: Mon Sep 11, 2006 10:36 pm
by abc123
How do I do it?

Posted: Mon Sep 11, 2006 10:40 pm
by DSguru2B
There used to be a job at ADN. It would clear the log files of all the jobs in a project. Try to see if its still there. Thats one of the ways to clear the log files of multiple jobs at the same time.

Posted: Tue Sep 12, 2006 6:40 am
by kduke
This job is not a recommended practice. This job would loop through all jobs and clear file on RT_LOGnnn.

You should setup logs to autopurge.

Posted: Tue Sep 12, 2006 8:17 am
by abc123
kduke, can you tell me why this job is not a recommended practice? Does it cause any damage anywhere else in the system?

Posted: Tue Sep 12, 2006 10:21 am
by DSguru2B
Whenever you get the time Kim, please elaborate on the cons of this practice.
Is it because it loops through all the jobs. If thats the case then a person can tweak it to clear logs of only a subset of jobs by changing the source to a sequential file which has the job ids of only the a few jobs.

Posted: Tue Sep 12, 2006 12:44 pm
by kduke
There are people who do this but if a job is running and you clear the log file it is just not smart. The phantom process is updating this table and rows disappear. If everyone is off the system and you do this then it is probably safe. The RT_LOGnnn files have surrogate keys. The next available key is one of the records you delete when you clear this file. DataStage seems to recover from clearing these log files but still it is better to autopurge.

If you really need this code then someone could just post it. It is a batch job, so it is all code.

Posted: Tue Sep 12, 2006 12:57 pm
by DSguru2B
O yes. I have been using it uptill now at times when we run out of space. But even when i go for it, i make sure i do it when there is no one logged on or no DS jobs are running in that environment. I just wanted to make sure there are no other cons with it that might prove dangerous to the project even after taking the precautionary measures.
Thanks Kim.