June 21, 2002 at 10:51 am
Is there a way to set up an alert that will tell me when a scheduled maintenance job (Like transaction log backup) is running too long or that it has not completed. I had a transaction log backup run for over 15 hours one night, thus all my other jobs would not run. Any suggestions would be great.
June 21, 2002 at 10:56 am
You could run a job that checked sysjobhistory. A simple job might just check for jobs that started that had been in progress more than an hour or so, a better one check previous history of the job to determine the average run time.
Andy
June 21, 2002 at 11:13 am
I understand what you are trying to say, but I am not sure how to do that. In looking at sysjobhistory, it does not look like I can see current jobs running. Or can I and how would I do that.
[/quote]
June 21, 2002 at 12:38 pm
I'll try to find some code for you this weekend - if no one beats me to it!
Andy
June 21, 2002 at 2:48 pm
That would be great. Thanks!!
[/quote]
June 24, 2002 at 2:13 am
Hey,
We produced a solution here that does what your asking. It's very simple...
Basically, we have a table that holds the name of a job and the start time.
At the beginning of a scheduled job, we insert the job name and start time into the table.
Every 2 mins, we run a SP which checks the table. It looks for any jobs running for over 5 minutes. If any jobs run for over 5 minutes, it fires an eMail.
Once the Scheduled Job is complete, the final step, removes the step (using job name as an lookup).
Obviously, this only works for 5 minute checks. You could make it more complex by defining a table which has all the jobs listed and acceptable execution times against them and do a lookup against that. I was going to do that but I keep forgetting! Hope that kind of gives you an example. If you want any more info, let me know, I'll post some of my code!
The reason we run the check every 2 minutes is that we are downloading orders from our JDE system so that the warehouse can pick/ship parts...so we need to ensure a quick download at all times during the day!!
Clive Strong
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply