When I was researching this problem, I came across this:
SQL SERVER: How Can I Get Notification Alert When Fail Over Happened? This got me started down the right path but it turns out to be simpler.
First, a bit of background on the fail over. When fail over occurs, the clustering services on the remaining nodes detect that failure. They attempt to shut down services on the failing machine. As soon as that completes or when the machine is deemed inaccessible, the clustering service starts SQL Server services on the new active node. We can take advantage of that stop service/start service process because SQL Server Agent has a hook in its scheduler that can start a job when SQL Server Agent starts (see the screenshot to the right).
Here are the steps:
- Create the new job.
- Name it something like "Agent Restart Notification".
- Add at least one step.
- It can be an empty step with some do-nothing code in it, but it has to be there (otherwise the scheduler will not enable the job).
- Add a schedule, but choose Start automatically when SQL Server Agent starts.
- On the notifications page, send an email when the job completes.
- Please note that you must have Database Mail enabled and properly configured.
- You must also have an Operator properly configured.
- Save the job.
That's it. Next time the SQL Server Agent restarts, you will receive a notification. There's one problem here, of course. What if the SQL Server Agent restarts because of some other event, like someone manually restarting it? Unfortunately more complex code is necessary for such a specific event. To get started with that, see the above referenced blog post. As for me, this serves my purposes well enough.
hi
ReplyDeleteThe reason why millions have already switched to VoIP is because it offers the same service with additional services for a lower cost and efficiently. However, critics have raised a few concerns regarding the security of a VoIP service. The fact of the matter is that all the security threats that apply to an internet service apply to a VoIP service.
ReplyDeleteWe are an independent escorts agency providing Call Girls job in Gurgaon. Call Girls job in hotels, We mainly targeted to the clients satisfaction and fully co-operative service providin you Escorts Girl Job in Gurgaon. We never disclose any identity to any third person. We also provides accommodations,we are looking an independent girl who can work with independently as a Female Escorts Job in Gurgaon.
ReplyDeleteThe recruitment will be on face to face interview and we need some pics for finalize the girls. The girls should be good looking to do Call Girls job in Gurgaon, good body structure and can work with us independently. Any Girls from any city can join us for Escorts Girl Job in Gurgaon and become a Call girls. We are hiring Female Escorts Job in Gurgaon also.