hang - it does not fail so we don't get an email it is just
"executing" - forever.
How could I test for this situation to generate an email if the job
runs longer than say 15 minutes?
Thanks
Billbill.. <b@.c.com> wrote in message news:<1tejqvkdp38mbv4rgncm373mu70af5306b@.4ax.com>...
> using SQL7 and we have very occasionally had ascheduled nightly job
> hang - it does not fail so we don't get an email it is just
> "executing" - forever.
> How could I test for this situation to generate an email if the job
> runs longer than say 15 minutes?
>
> Thanks
> Bill
Oen possibility is to query msdb..sysjobhistory and check the
run_status to see is it's still executing. You could also consider
finding the average run time for the job from the same table, and then
send an email only if the current execution time exceeds the average
by a certain threshold.
Simon|||Create another first step in the job to write the job name and start
datetime to a table. Add a final setp to write the completion.
Now have a schedule job to check for the start and completion - if the
completion does not turn up for 15 mins (can also check for the start)
then send an email.|||both good ideas
Thanks
Bill
No comments:
Post a Comment