2018年8月22日 星期三

How To Safely Delete SQL Server ErrorLog Files

How To Safely Delete SQL Server ErrorLog Files


By default SQL Server stores seven ErrorLog files named:
  • ErrorLog
  • ErrorLog.1
  • ErrorLog.2
  • ErrorLog.3
  • ErrorLog.4
  • ErrorLog.5
  • ErrorLog.6
n SQL Server 2005 and later versions, the ErrorLog files are stored in the c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG folder.  The ErrorLog file contains the newest information; the ErrorLog.6 file contains the oldest information. 

If one of the ErrorLog files has grown to a large size, the ErrorLog files can be manually cycled by running the sp_cycle_errorlog Stored Procedure.  

Delete 
  • ErrorLog manually

In SQL Server Management Studio, open the MANAGEMENT folder, then right click on SQL SERVER LOGS and say CONFIGURE.  Check the LIMIT ERROR LOGS box and set the number to 30 (a month's worth).  Now, set up a new job in the SQL Agent that runs sp_cycle_errorlog every night at midnight.




Found on Spiceworks: https://community.spiceworks.com/topic/564167-clearing-sql-server-errorlog-files?utm_source=copy_paste&utm_campaign=growth

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。