Deleting logs of multiple jobs simultaneously

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Deleting logs of multiple jobs simultaneously

Post by abc123 »

How do I do it?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post 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?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply