Microsoft SQL Server ErrorLogs and Transaction Logs Eating Your Storage?
by J. Miller on Dec.07, 2008, under Computers, Operating Systems, Reference, Software, Tweaks, Windows
Is your server’s c:\ running out of space due to MSSQL service writing insanely large log files? Yeah Ok… While this can be quite annoying, if this is all you have to worry about all day enjoy your free time. Relocating the log files is something you can do pretty quickly; and you can get this done with limited downtime. Of course non-peak off hours are the best time for any system enviroment changes as this.
So lets see what options you have…Ok so… I’m sure its an obvious one, but your first option is to start using MySQL instead of MSSQL, but I digress.
Stuck with MSSQL? Scheduled your downtime? Well then get the logs moved real quick and be done with it.
How-To Move the Microsoft SQL Server ErrorLogs and Transaction Logs
- Open the SQL Server Configuration Manager and select the instance of SQL Server or SQL Agent Service who’s logs you’re moving.
- Now stop that service while you move the logs and reconfigure its startup parameters.
- Begin the file copy/move to the new location.
- Change the startup parameters for whichever instance you’re moving the logs for within the ‘advanced’ tab under the properties options.
The advanced properties ’startup parameters’ will have the following syntax:
- -d[Master DB]; -e[ErrorLog Location]; -l[Master DB Log]
- -dC:\Program Files\Microsoft SQL Server\MSSQL\DATA\master.mdf;-eC:\Program Files\Microsoft SQL Server\MSSQL\ERRORLOG;-lC:\Program Files\Microsoft SQL Server\MSSQL\DATA\mastlog.ldf
You can also change the ‘Dump Directory’ location under the same advanced tab. This will relocate the location of Default Trace files. As well as many other parameters.
Prefer to do some registry hacking and move the SQL Server Agent’s ErrorLog?
- Open your favorite registry editor.
- Find the correct key.
(ex. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL\SQLServerAgent) - Edit the “ErrorLogFile” value.
- Restart your MSSQL Server.
Related posts: