SQL Server Agent Not Starting -- FIX



If you get any of below errors :

  1.  The SQL ServerAgent service on started and then stopped
  2.  The Request failed or the service did not respond in timely fashion. Consult the event log or other applicable error logs for detail.
  3.  StartServiceCtrlDispatcher failed (error 0).
  4.  Unable to renameSQLAGENT.OUT to SQLAGENT.1 (reason: The process cannot access the file because it is being used by another process)
  5.  [257] Startup error: Another instance of SQLServerAgent is already servicing server instance
  6.  [098] SQLServerAgent terminated (normally)
Screen shots : 

If you start sql server agent from configuration manager



If you start sql server agent from SSMS

When sql server didn't start i tried to start same from command prompt. To find sql agent exe check here



If sql agent is not coming and error is not clear then start sql server in console/ verbose mode as below










This simply means SQL server agent is not able rename existing file. So we have to move existing sql agent  log agent log file from current location. is also available here

/*******************************************************************/

sp_configure 'show advanced options' ,1

go 

reconfigure with override

go

sp_configure 'Agent XPs' , 1
go
reconfigure with override
go
EXEC msdb..sp_get_sqlagent_properties
GO
EXEC MSDB.DBO.SP_SET_SQLAGENT_PROPERTIES @ERRORLOG_FILE=N'C:\SQLAGENT.OUT'
GO
EXEC msdb..sp_get_sqlagent_properties
GO
/*******************************************************************/

If this doesn't work the we have to directly go to registry and fix same. But make sure you are pointing to correct "sqlagent.out". If you have more than one instance than be careful.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL server\MSSQL11.MSSQLSERVER\SQLServeragent\Errorlogfile














For me its changed from registry, Make sure before modifying registry you should take backup of same.

4 comments: