Thursday, January 28, 2010

SQL Server error log is too big

Every time when SQL server starts a new error log file is added a Current log file. But if server is running from long time the size of current log file increases too much. Some time it become so heavy that takes long time to open. Searching a information in a big error log also take long time and difficult rather than a small file. So how can we start a new error log file without restarting the server? For this purpose SQL server have a stored procedure: sp_cycle_errorlog. It takes no parameter and can be executed from any database as below.

EXEC sp_cycle_errorlog

Each time we execute this stored procedure a new error log file is added as current log file and if the number of log files exceeds maximum than the oldest files is deleted from list. If you want to increase the number of allowed log files then please check another blog:

No comments: