debugsqlMajor
Safe way to truncate SQL Server Error Log
Viewed 0 times
errorlogsqlwaytruncatesafeserver
Problem
We are running out of space. What is the safe way to clear the error log?
Solution
You can cycle the error log by calling
When you do this, you should see a new log file with an entry that resembles the following:
The error log has been reinitialized. See the previous log for older entries.
BOL reference on
sp_cycle_errorlog and then that will close the current error log and cycle the log extensions. Basically, it'll create a new error log file that SQL Server will be hitting. Then the archived error log(s) can be treated accordingly (delete/move with caution). This will not technically "truncate" the log, it'll just roll it over and you can handle the old logs as you so please, like any other file system file.When you do this, you should see a new log file with an entry that resembles the following:
The error log has been reinitialized. See the previous log for older entries.
BOL reference on
sp_cycle_errorlogContext
StackExchange Database Administrators Q#31298, answer score: 21
Revisions (0)
No revisions yet.