Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/16/2024 07:50 AM
Do we have any table to list our Schedule jobs and their run status?
07/16/2024 07:54 AM - edited 07/16/2024 07:54 AM
Hi @Priyadharsini , ecmimportjob table will provide you with the details.
07/16/2024 10:22 AM
@Priyadharsini try below query in reports and run it
select
a.ANALYTICSNAME,
a.CREATEDATE 'Created On',
a.LASTRUN 'Report previous Run',
qt.TRIGGER_NAME 'Job Name',
qct.CRON_EXPRESSION,
FROM_UNIXTIME(qt.NEXT_FIRE_TIME/1000) 'Job next fire time',
FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000) 'Job previous fire time',
case
when FROM_UNIXTIME(qt.Next_FIRE_TIME/1000) > now()=1 and date(FROM_UNIXTIME(qt.Next_FIRE_TIME/1000))=date(now()) then 'Yet to run'
when date(a.lastrun)=date(FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000)) and date(FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000))=date(now()) then 'Report ran successful as scheduled'
when date(a.lastrun)!=date(FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000)) and date(FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000))=date(now()) then 'Report run mismatch'
end as 'Report run status',
a.METADATA 'Run summary details'
from
analyticsconfiges a, qrtz_triggers qt, qrtz_cron_triggers qct
where
qt.TRIGGER_NAME=concat('Analytics_',a.ANALYTICSKEY,'CRONE')
and qt.TRIGGER_NAME=qct.TRIGGER_NAME
07/16/2024 12:27 PM - edited 07/16/2024 12:28 PM
select
a.ANALYTICSNAME,
a.CREATEDATE 'Created On',
a.LASTRUN 'Report previous Run',
qt.TRIGGER_NAME 'Job Name',
qct.CRON_EXPRESSION,
FROM_UNIXTIME(qt.NEXT_FIRE_TIME/1000) 'Job next fire time',
FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000) 'Job previous fire time',
case
when FROM_UNIXTIME(qt.Next_FIRE_TIME/1000) > now()=1 and date(FROM_UNIXTIME(qt.Next_FIRE_TIME/1000))=date(now()) then 'Yet to run'
when date(a.lastrun)=date(FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000)) and date(FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000))=date(now()) then 'Report ran successful as scheduled'
when date(a.lastrun)!=date(FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000)) and date(FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000))=date(now()) then 'Report run mismatch'
end as 'Report run status',
a.METADATA 'Run summary details'
from
analyticsconfiges a, qrtz_triggers qt, qrtz_cron_triggers qct
where
qt.TRIGGER_NAME=concat('Analytics_',a.ANALYTICSKEY,'CRONE')
and qt.TRIGGER_NAME=qct.TRIGGER_NAME
select
qt.TRIGGER_NAME 'Job Name',
qct.CRON_EXPRESSION,
FROM_UNIXTIME(qt.NEXT_FIRE_TIME/1000) 'Job next fire time',
FROM_UNIXTIME(qt.PREV_FIRE_TIME/1000) 'Job previous fire time'
from
qrtz_triggers qt, qrtz_cron_triggers qct
where
qt.TRIGGER_NAME=qct.TRIGGER_NAME
07/16/2024 01:47 PM
Use below query
Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.