http://www.sqlservercentral.com/blogs/basits-sql-server-tips/2012/06/06/unable-to-recycle-sql-agent-log-sqlserveragent-error-32/

Printed 2014/12/18 02:58AM

Unable to recycle SQL Agent log: SQLServerAgent Error: 32.

2012/06/06

Today the maintenance job that recycles the SQL Agent error log failed on one of our production SQL Server with the following error message:

Message: Executed as user: MyDomain\_svcSQLServer. SQLServerAgent Error: 32. [SQLSTATE 42000] (Error 22022). The step failed.

This job uses [dbo].[sp_cycle_agent_errorlog] procedure that resides inside msdb, which enables you to cycle the error log files without stopping and starting the server. When I tried to execute the [dbo].[sp_cycle_agent_errorlog] manually in SQL Server Management Studio it failed with following error message:

Msg 22022, Level 16, State 1, Line 0
SQLServerAgent Error: 32.

I researched this issue and found that the SQL Agent log file was locked by other process. I killed the process that was locking the SQL Agent log file, restarted the SQL Server Agent service and this time job successfully recycled the SQL Agent error log.



Copyright © 2002-2014 Simple Talk Publishing. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.