The first one extracts the start time and duration (in seconds) of each crontask execution in the last week.
select crontaskname, to_char(starttime,'YYYY-MM-DD HH24:MI:SS') as starttime, (endtime-starttime) as duration from CRONTASKHISTORY where endtime>sysdate-7 and activity='ACTION' order by starttime;
I typically import the output of this query into an Excel spreadsheet and analyze it sorting by whatever column I need. Furthermore, you can create a pivot table or chart to analyze the data. This is an example of what can be achieved:
If you are not familiar with Excel, here is a query that generates the same output straight from an SQL query:
select crontaskname, sum(endtime-starttime) as totalduration from CRONTASKHISTORY where endtime>sysdate-7 and activity='ACTION' group by crontaskname;
Is there any approach to monitor cron task execution and have notifications sent if any cron doesnt start on time or get errored out ?
ReplyDelete