Recycle SQL Server Log Files


You have two ways to recycle SQL Server log files: restart SQL Server Instance or through T-SQL: sp_cycle_errorlog.

Set how many error log files you want to keep before they are got recycled: you can choose 30 from:

Management
>>SQL Server Logs
>> right clcik on it and choose Configure
>>Check the checkbox for Limit number of error log files before they are recycled and change the Maximum number of error log files: 30
Click OK.

Create a new job to run this : sp_cycle_errorlog as T-SQL
and schedule it to run at midnight every day.

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