Is there a heartbeat?
Dammit Jim, I’m a DBA not a doctor!
On our servers we have heartbeats in our SQL Agent Jobs. A heartbeat is a start and end step that we put into each of our jobs. If you do use it, do you use the same terminology or do you have a different word for it? If you’re not using one, I highly recommend it.
For example, compare the two screen shots below. The first one shows a job which has one step in it. The job is currently running. What can you tell by looking at the job history?
The second example shows the job with the same scenario, but it has a Heartbeat.Notification and a Heartbeat.Termination step in it.
The job with the heartbeat has a step that has already completed. If I look at the job history, I have information available if I need to troubleshoot problems with the running job. This would have been very helpful when I was once troubleshooting a job that had been running for multiple days, unexpectedly.
That being said, always test changes before making them – no matter how simple they appear to be. I once modified a job to include the heartbeat steps. It turns out that one of the job steps referenced output files from another step in the job. When I changed the steps around, it was referencing the wrong step’s output file.


[...] Crys Manson on heartbeats in Agent jobs – if you’ve got SQL Agent jobs that could run for hours, wouldn’t it be great if you could add a heartbeat step that would record its status in Job Monitor? (Crys didn’t blog much in 2010, but I’m determined to push her out of her comfort zone in 2011. (You could also read that as me making Crys uncomfortable, but I’ve already done that in 2010 to everyone I know by wearing a Richard Simmons costume on camera, nothing new there.)) She knows a ton of good stuff and she’s doing killer things at work with SQL Server. She must share this. Now. [...]
Hi Crys, yes I’ve been using something similar for ages, and complained about it on Connect:
http://connect.microsoft.com/SQLServer/feedback/details/273940/
I name these steps “initialize” – heartbeat is a good word but to me it implies that it will update the status periodically throughout the process, rather than just at the beginning (and, in your case, at the end).
[...] of our jobs. If you do use it, do you use the same terminology or do you have a different word… [full post] Crys Manson Crys's Crap ssms 0 0 0 0 0 [04 [...]