RT_STATUS structure for deleting invocation ids

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
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

RT_STATUS structure for deleting invocation ids

Post by clarcombe »

I have been challenged with the task of writing a routine to clear out the invocation entries from RT_STATUS and RT_LOG for any entry older than a specific date.

1) This is fine for RT_LOG entries as there is a timestamp but how can I do this for RT_STATUS

2) I would lurrvve to get the structure for all the tables. How can I do this ?

TIA
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Hacking is the only way to get these strutures. The API is the only approved way to read these strutures. Very few APIs update these strutures.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In the RT_STATUSnnn table the invocation ID is part of the key.

Code: Select all

SELECT @ID FMT '60L' FROM RT_STATUSnnn;
So much for identifying the records, what are they? There are records for jobs, active stages and resources - you have to make sure that you get them all. Start with investigating the record type.

Code: Select all

SELECT @ID FMT '46L', F1, F2 FROM RT_STATUSnnn USING DICT VOC;
will get you started.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Thanks.

I will try that when I get back to the office next week
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

The plot thickens....

The customer wants to ensure that only the instances pertaining to the log purge settings are removed. i.e. I remove only the instances RT_STATUS older than 5 days. RT_LOG entries have already been removed using the Auto Purge

Using Ray's modified code I have generated these results from RT_STATUS

SELECT @ID FMT '46L', F1,F5 FROM RT_STATUS27 USING DICT VOC WHERE F1 ='INVOCATION'

Which gives me
  • VOC GFMEntetereal.011044
    F1 INVOCATION
    F5 DSD.RUN_59536_13921
However, there is no way to access the date in order to delete on this,but I can see this date in Director. Does anyone know how this can be achieved ?
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Colin,

the purge settings are in the log file in the record //PURGE.SETTINGS. You would need to read this record, decide if the log's settings are for {n} days or {n} runs and then go through all of the RT_LOG files records and remove only those that are applicable. I assume that this is a bit more complex that you had originally hoped. I just finished writing some code that does this for all log files on a system, on the DEVelopment server it removed 16Gb of extraneous log information; so it was worth the effort. I can't post the code as it is no longer mine, though.
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Arnd,

Thanks for the response.

I am not so worried about picking up the purge settings as the actual logs have been purged.

What I need is the date associated with the instance/invocation. It is shown in Director but I have no idea which date this is in the Universe tables.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It would be in the RT_STATUS file, where the key contains the instance name and the start date is in column 3.
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

I tried the SQL

SELECT @ID FMT '46L', F1, F2,F3,F4,F5,F7 FROM RT_STATUS27 USING DICT VOC WHERE F1 ='INVOCATION'

But F3 gives me 1

It is certainly true that the 3rd field in RT_LOG is the timestamp.

If I am wrong could you please give me the SQL required

Thanks
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

F1 needs to be "JOB" and the invocation ID is part of the record ID.

Code: Select all

SELECT F3 FROM RT_STATUS7 USING DICT VOC WHERE F1 = 'JOB' AND @ID LIKE '%instance%';
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

HI,
You can directly use TIMESTAMP as key word like
SELECT TIMESTAMP FROM RT_LOGnnn or SELECT F3 FROM RT_LOGnnn DICT VOC
to get the timestamp of each id.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, you can do that. But that isn't what Colin is asking. He is looking for the instance information.
nikhilanshuman
Participant
Posts: 58
Joined: Tue Nov 17, 2009 3:38 am

Post by nikhilanshuman »

clarcombe wrote:The plot thickens....

The customer wants to ensure that only the instances pertaining to the log purge settings are removed. i.e. I remove only the instances RT_STATUS older than 5 days. RT_LOG entries have already been removed using the Auto Purge

Using Ray's modified code I have generated these results from RT_STATUS

SELECT @ID FMT '46L', F1,F5 FROM RT_STATUS27 USING DICT VOC WHERE F1 ='INVOCATION'

Which gives me
  • VOC GFMEntetereal.011044
    F1 INVOCATION
    F5 DSD.RUN_59536_13921
However, there is no way to access the date in order to delete on this,but I can see this date in Director. Does anyone know how this can be achieved ?

Hi,

F1 returns the jobname with invocation id.Using the function DSGetJobInfo you can get the start time of the jobs.
Nikhil
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Holy thread necromancy, Batman.
-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 »

Zip, zoom, pow. The Riddler is down.
Mamu Kim
Post Reply