sql 2014 --jobs

  • Can we stop and start sql server agent based on AG failover ? Instead of editing all the jobs/job steps to check which one is primary before running, it sounds like a good idea if we can stop and start the agents accordingly. Any suggestions?

  • So far as I know, the approved method is to check to see if the server is the primary. I'm sure you could write a PowerShell routine that cycles through the servers, identifies which ones are currently online and primary and disables the other SQL Agents, but it would have to run pretty frequently to keep up with any failover. I'd just go with the standard method.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • muthyala_51 (8/4/2014)


    Can we stop and start sql server agent based on AG failover ? Instead of editing all the jobs/job steps to check which one is primary before running, it sounds like a good idea if we can stop and start the agents accordingly. Any suggestions?

    Not really going to work as stopping the agent will affect the whole instance. The instance that is a secondary replica may have other databases on it that are not part of the AlwaysOn group and still require a functioning agent.

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply