Page 1 of 1

How to get job name which log not cleared

Posted: Fri Nov 26, 2004 6:32 am
by arunverma
Can any body help me that how to get job name from universe which log not cleared before 3 days from sysdate .

Posted: Fri Nov 26, 2004 9:16 am
by roy
Hi,
Can you explain why you might need this info for?

this might be better for other's opinion on the best way to acomplish what you need.

IHTH,

Posted: Fri Nov 26, 2004 10:02 am
by chulett
You are probably better off making sure that all of your jobs have their Auto-Purge settings correct so that this happens automatically. There is a post here with discussion of the issue plus code for a routine that will update the settings for you.

Posted: Fri Nov 26, 2004 3:19 pm
by ray.wurlod
Arun is at a site that has the 5.2 bug where auto-purge isn't propagated into newly-created jobs.
Probably the easiest way is to create a routine or script that retrieves the oldest message in the log file and obtains the timestamp from that entry.

Code: Select all

FUNCTION OldestEntryTimeStamp(JobNo)
Ans = @NULL
LogFileName = "RT_LOG" : JobNo
Open LogFileName to hLogFile
Then
   Command = "SELECT TIMESTAMP TO SLIST 9 FROM " : LogFileName 
   Command := "  WHERE CAST (@ID AS VARCHAR) NOT LIKE '//%' ORDER BY 1;"
   Perform Command
   ReadNext Ans FROM 9
   ClearSelect 9
   Close hFile
End
RETURN(Ans)

Posted: Sat Nov 27, 2004 12:05 am
by arunverma
Hi Chulett/Roy

Actualy we hacve faced problem in DS server few days back , one person run DS job with NO limit option and around 100000 log entry created and as result serevr hang , so I want to monitor DS job , Log must be 3 days only .

We have successfully migrated DS from 5.2 to 7.1 and at project level we have also seted auto purge but it is not working . so should we take export backup of whole project , clean project and set auto purge then import complete job , will it be work ?


Thanks Ray ,

In routine which given by you , we have to pass job Name ? , if so then we have to run this routine for all jobs , if it is possible from universe command ?

Regards

Arun Verma

Posted: Sat Nov 27, 2004 1:02 am
by chulett
arunverma wrote:Actualy we hacve faced problem in DS server few days back , one person run DS job with NO limit option and around 100000 log entry created and as result serevr hang , so I want to monitor DS job , Log must be 3 days only .
That's not going to help when someone runs jobs with no warning limit that create huge logs like that. :? Better to crack down on the people doing this and make sure they don't do it again.
arunverma also wrote: We have successfully migrated DS from 5.2 to 7.1 and at project level we have also seted auto purge but it is not working . so should we take export backup of whole project , clean project and set auto purge then import complete job , will it be work ?
That setting only applies to new jobs, created after the setting was made. Are you saying that this is not happening, even after upgrading? Or is it just the old jobs that have the problem? The first would be a bug, the second would be normal.

If it is the old ones, the routine in the post I linked to will allow you to fix the problem without going to the trouble of the export/import.

Posted: Sat Nov 27, 2004 1:39 am
by arunverma
Thanks Chulett

Yes it is true , auto purge is working for new job , I am gonging to implement that suggestion give by you and Mr. Ray.

Regards

Arun

Posted: Sat Nov 27, 2004 3:46 pm
by ray.wurlod
There is another routine in my most recent report for your site which can load the purge settings for existing jobs that don't have them. If no-one else has this routine you can obtain a copy from Rajiv Gupta.

Someone at your site could easily adapt these routines to scan through your job logs to find those with lakhs of entries. But do you really want to get rid of these before the reason for the warnings has been diagnosed and corrected?