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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: