:::: MENU ::::

Create new SQL Agent logs archive files without restart in SQL Server 2005

  • Oct 06 / 2008
  • 0
dbDigger, SQL Server Agent scheduled Jobs, System Stored Procedures, T-SQL Scripts

Create new SQL Agent logs archive files without restart in SQL Server 2005

Just like SQL Server Logs Files, SQL Agent logs archive files are also processed during restart of SQL Server agent. A new SQL Agent file is created and oldest one is replaced if maximum count is exceeded. In situations where production servers remain online with critical jobs scheduled, SQL Agent is not restarted for days and even months. So a way is required to process the SQL Agent logs files without restart. Following system stored procedure will do it for you in SQL Server 2005.

 
USE MSDB  
 GO  
 EXEC sp_cycle_agent_errorlog  
 GO  

As a result new logs archive file for SQL Agent logs will be created, just as it would be through restart of SQL agent Service.

Consult us to explore the Databases. Contact us