SQL Server Agent issue

  • I am running into an issue and hoping to get some help. Every time I reboot my server, SQL Server service and agent starts automatically. I see that the Agent is running but when I run a job or any job, I get this error (See screenshot below). I then restart the SQL agent and it works. I don't see information in the log file where I know what to do to prevent this from happening. I do want the SQL server agent up and running after the server reboot without me having to restart it again. Any advise is highly appreciated.

     

     

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • Try changing the SQL Server Agent startup type to "automatic (delayed start)" to make it start after SQL Server.

    I personally have never needed to do that, but I have with other services unrelated to SQL Server.

    Alternately, I would check all of the logs to see if there is anything interesting happening when the agent is starting or when you go to start a job.  By all of the logs, I mean the SQL logs, the SQL agent logs, the windows logs... pretty much any logs that may be relevant.  And by "interesting", I mean if there are any warnings or errors in any of the logs around the time the agent is starting from a reboot OR when you go to run a job and potentially any time in between.  It could be the agent starts successfully after boot but then something happens to break it.

    My last tip would be to make sure your SQL Server is fully patched.  Could be a bug in sql that is fixed in an SP/CU.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • My guess is someone changed or never set this Agent to start up. The service ought to be dependent on SQL Server, so that it won't start until the database engine starts.

    https://serverfault.com/questions/24821/how-to-add-dependency-on-a-windows-service-after-the-service-is-installed

  • Mr. Brian Gale wrote:

    Try changing the SQL Server Agent startup type to "automatic (delayed start)" to make it start after SQL Server.

    This is what fixed us a long time ago.  I just automatically set it up that way on any new/mirated servers since the original problem we had.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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