You have a couple or more SQL Servers with some sort of High Availability solution between them (AlwaysOn Availability Groups, Database Mirroring, etc.). You also have a bunch of scheduled jobs which you need to be run on the Primary server.
But wait…. How would you make these jobs run only on the Primary server? After all, if they try to run on the Secondary, they might fail (whether because the database is inaccessible or because it’s read-only). Additionally, you would need to consider a failover where the Primary and Secondary servers would switch roles.
This means that you would have to create these jobs on both servers, and then implement some sort of mechanism that would detect, for each job, whether the instance it’s being executed at is currently the Primary.
There are a few ways to go about doing this. During this session we will cover possible solutions, downfalls, tricks, and much more.
Download Slides Deck
This session was delivered at the following events:
- Madeira Data Solutions – Free Live Webinars (July 7th, 2020)
- HA/DR PASS Virtual Group (September 15th, 2020)
- SQL Friday #16: Eitan Blumin on “How to HADR Your SQL Jobs” (September 18th, 2020)
If you want me to deliver this session at an event that you’re organizing, whether it’s an online or venue event, please fill out the form below. Thanks!