I am a SQL DBA and need some help.
We currently have two 2012 SQL Servers in High Availability.
I scripted and placed the jobs on both Servers and added the 1st step to all them utilizing the following script:
IF dbo.fn_hadr_is_primary_replica ('db_name') <> 1
RAISERROR('This is not the preferred replica, exiting with success',11,1)
So, the jobs are basically running according to their schedules on both Servers, and exiting the 1st step with Success if: dbo.fn_hadr_is_primary_replica ('db_name') <> 1
It works fine. but this is not a fancy solution at all.
For example, since the SSIS Packages reside in the Catalogs that I created, for executing them it does not matter from which job and on which Server they are running.
Is there a way do something like that with the jobs; anotherwords set some Centralized location for them and run all the jobs from this location?
Or maybe there anybody is aware of a better way to set up the jobs in AlwaysOn?
Any help with this matter will be greatly appreciated.