Page 1 of 1

RT_STATUS structure for deleting invocation ids

Posted: Thu May 04, 2006 9:09 am
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

Posted: Thu May 04, 2006 9:37 am
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.

Posted: Thu May 04, 2006 2:52 pm
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.

Posted: Fri May 05, 2006 9:19 am
by clarcombe
Thanks.

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

Posted: Thu May 11, 2006 3:33 am
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 ?

Posted: Thu May 11, 2006 3:55 am
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.

Posted: Thu May 11, 2006 4:03 am
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.

Posted: Thu May 11, 2006 4:48 am
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.

Posted: Thu May 11, 2006 5:00 am
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

Posted: Thu May 11, 2006 5:07 am
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%';

Posted: Thu May 11, 2006 5:21 am
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.

Posted: Thu May 11, 2006 5:25 am
by ArndW
Yes, you can do that. But that isn't what Colin is asking. He is looking for the instance information.

Posted: Tue Dec 15, 2009 1:27 am
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.

Posted: Tue Dec 15, 2009 6:23 am
by chulett
Holy thread necromancy, Batman.

Posted: Tue Dec 15, 2009 10:08 am
by kduke
Zip, zoom, pow. The Riddler is down.