Home Database Using DBCC ErrorLog Command To Cycle SQL Error Log Files

Using DBCC ErrorLog Command To Cycle SQL Error Log Files

1010
0

Each time SQL Server is restarted, the ERRORLOG file is recreated, and your existing error log is renamed ERRORLOG.1
The existing .1 (if any) is renamed .2 and so on to .6

This is done to ensure that the server starts up quickly with a fresh error log file.

Since the current ERRORLOG file is locked, you will have to either restart the server or use the Database Consistency Check (DBCC) ErrorLog command to cycle the files and unlock the current file.  Then you can either work with or delete the current file (which has been renamed .1)

Open a new query and RUN this command:

Exec (‘DBCC ErrorLog’)

NOTE: DB Servers for MOM, MOSS or SMS should probably have this task scheduled for off times when server activity is low to reduce impact on performance.

NOTE 2: There is also a Stored Procedure (SP) Sp_Cycle_Errorlog that will accomplish the same task:
Exec Sp_Cycle_Errorlog

LEAVE A REPLY

Please enter your comment!
Please enter your name here