Re: Running a script when Database Mirroring fails over
- From: Gerry Hickman <gerry666uk2@xxxxxxxxxxxxxxxx>
- Date: Thu, 14 May 2009 19:39:49 +0100
Hi,
I'm also interested in this. I assume you're not using a witness server?
ELS wrote:
Hi all-
I'm trying to determine the most efficient method for running a script after my Principal fails over to my Mirror within Database Mirroring.
I have seen a lot of information on blogs, etc. related to setting up alerts using WMI or a Service Broker. But from my testing, those are configured on the Principal server. If my jobs are configured to send a notification and run a script when the Principal fails over, how will those jobs execute if the Principal server completely crashes?
So, my thought was to create jobs on both the Principal and Mirror servers that monitor the sys.database_mirroring table. The jobs look to see if the mirroring_role for the database has changed (e.g. on the mirror server, I check to see if the mirroring_role for the database has changed to 1. If it has, send the notification and run a script). My job also disables itself and enables a second job to see if the role has switched back to the Mirror.
This works and I'm fine with it, but I thought I'd post to see if there is anything better (more efficient, less intrusive, whatever) than what I've come up with. I have to believe that other people smarter than I have encountered this, so I'm interested in alternative solutions.
Thanks in advance!
--
Gerry Hickman (London UK)
.
- Follow-Ups:
- References:
- Prev by Date: Re: Non-Sysadmin Job Owners not running under their own context
- Next by Date: Re: How best to meet these business requirements
- Previous by thread: Running a script when Database Mirroring fails over
- Next by thread: Re: Running a script when Database Mirroring fails over
- Index(es):
Relevant Pages
|