Clear Log of Multiple Instance jobs

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
avazeos
Participant
Posts: 3
Joined: Tue Jun 07, 2005 9:20 am

Clear Log of Multiple Instance jobs

Post by avazeos »

Hi to all,
I have two multiple instance jobs that are executed daily 300 times each. That means that 600 hundrends instances are created daily in the director making it very difficult to trace it. Is it possible to delete these automatically without loosing the log records that is under the main job?

Thanks in advance
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The 'official' answer is to recompile the base job, that will remove all instances of the invocation runs from the Director but not clear the log information. This can be problematical, however, if it is read only as most people have their production jobs, I would think. :?

Unofficially, there's been some discussion here but I don't recall if anyone came up with a viable option. I remember that issuing a 'Clear Status File' from the Director on an instance will remove it from the list but don't know off-hand how one would do that programmatically. Besides, I'm sure you'd prefer to pull the trigger once rather than 300 times.

Perhaps others will have some suggestions...
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I would turn on the automatic clearing of logs after 3 runs instead of days or something like that. That will help.

I posted a SQL statement which will delete RT_STATUSnnn records using instance id. Search for this post. I will post the link if you cannot find it. I know Director slows down a lot when you have this many instances.
Mamu Kim
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

without loosing the log records that is under the main job
But the log records are accumulated under main job only. The 300 instance are just the representation of it.

You may use something like

Code: Select all

DELETE RT_LOGnnn where EVAL "@ID" NOT LIKE '//%'
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The OP doesn't want to clear the logs, but rather the various Invocation ID instances from the Director's display... which is why Kim suggested a script [cough] hack [cough] to remove the appropriate RT_STATUSnnn records. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Okay it is a hack. How else can you do this? The only other way is to recompile this job.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Them's the two ways I know. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Geez, Craig they were in my downloads folder but there was no link on my tips page. There is now. I hope nobody minds me giving these out. They look pretty valuable.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, they do say you can lead a horse to water, but... :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply