Automic Workload Automation

 View Only

 SQL Query to get the auto-restarted jobs on specific day

Srinivas Reddy's profile image
Srinivas Reddy posted Oct 02, 2024 08:29 AM

Hi Community,

Hope everyone is doing well.

We have automic jobs are configured with auto-restart on specific return codes. Support teams want to get the list of auto-restarted jobs and how many restarts for each object on specific date.

Can we able to fetch the data from DB query? any suggestions or ideas?

Regards,

Srinivas.

marc broussard's profile image
marc broussard

hello

try  (you have to adapt a litte)

select 
OH_NAME as 'object name', 
OH_IDNR, OH_Client as 'Client', 
AH_Status,
OH_Otype as 'object type', 
AH_restart, 
dateadd(hour, datediff(hour, getutcdate(), getdate()), ah_timestamp1) as Activation_time, 
dateadd(hour, datediff(hour, getutcdate(), getdate()), ah_timestamp2) as start_time, 
dateadd(hour, datediff(hour, getutcdate(), getdate()), ah_timestamp4) as End_time
from OH, AH 
Where OH_IDNR = AH_OH_Idnr 
and OH_CLIENT = xxxxx 
and AH_restart = 1
and AH_TimeStamp2 BETWEEN '20241009 10:00' AND '20241010 18:00'
order by ah_timestamp2 DESC;

Marc Broussard
Equans Ineo