SQL Server Error Log Management

If you are in control of a website that has considerable traffic you have no doubt found that MS SQL Server will eat into hard drive space with it’s error log file.

Basically this file contains log information on the activity of SQL Server instance. However it can grow to a fairly large size and it is advisable to move it from you live server to some sort of backup.

You can’t just move this file though as it is in use the whole time, any attempt to cut and paste it or do anything with it will be blocked by MS SQL Server.

What you have to do it run a query command on the server. Open up your server management studio and type/paste in the following:

EXEC master.sys.sp_cycle_errorlog;

Basically this command ends the life cycle of the current error log and starts a new one. This will allow you to move the current error log off the server or to a backup hard drive on the server.

Resource: mssqltips.com

Advertisements

Published by

Alan Feekery

Developer, Gamer, Musician, Cyclist and big Motorsport fan... enjoys the odd cup of coffee :)

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