12-11-2014 06:42 AM - edited 03-01-2019 09:12 AM
Greetings forum members,
I was asked to determine the Tidal jobs that are scheduled to run during a particular timeframe on an evening. My question is whether this can be determined and extracted from the database tables? I've been digging in the tables, and have not found a way to determine such information. Our schedule is built three days in advance, so I know there's future schedules. Any assistance on how best to do this would be greatly appreciated.
Thanks,
Ken Little
12-11-2014 07:14 AM
Hi littlek01,
This information can be found in the jobrun table,
EstimatedStartTime | jobrun_esttime | datetime : Estimated start time determined by compiler
For example,
SELECT
dbo.jobrun.jobrun_proddt,
dbo.jobmst.jobmst_prntname,
dbo.jobmst.jobmst_name,
dbo.jobrun.jobrun_esttime
FROM
dbo.jobmst INNER JOIN
dbo.jobrun ON dbo.jobmst.jobmst_id = dbo.jobrun.jobmst_id
WHERE
dbo.jobrun.jobrun_time BETWEEN 'start date/time' AND 'end date/time'
BR,
Derrick Au
12-11-2014 07:18 AM
Alternatively, if there are no new jobs introduced into the schedule and assume there are no delays, one can easily look back in the past and see which jobs run within a particular time frame. In this case, instead of using jobrun_esttime, OK to replace with jobrun_runtime (which is the actual start time of the job).
12-11-2014 08:37 AM
I don't see the column jobrun_runtime in the jobrun table. Is that the correct table?
Is that the history table? If so, can you extract the actual runtime of the job?
Thanks, Ken
12-11-2014 08:43 AM
Hi Ken,
Sorry about that, it should be jobrun_time. I've corrected the query below:
SELECT
dbo.jobrun.jobrun_proddt,
dbo.jobmst.jobmst_prntname,
dbo.jobmst.jobmst_name,
dbo.jobrun.jobrun_esttime OR dbo.jobrun.jobrun_time
FROM
dbo.jobmst INNER JOIN
dbo.jobrun ON dbo.jobmst.jobmst_id = dbo.jobrun.jobmst_id
WHERE
dbo.jobrun.jobrun_esttime OR dbo.jobrun.jobrun_time BETWEEN 'start date/time' AND 'end date/time'
Thanks,
Derrick Au
12-11-2014 08:34 AM
Thanks Derrick! I plugged in the query as mentioned and got all the jobs from the time window last night. Thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide