Solved

How do I move SQL Server error log files from the default location?

Posted on 2008-10-06
12
2,823 Views
Last Modified: 2012-05-05
Hello all, I need to move the SQL Server error logs from the default C: to a different partition. Can someone tell me how to do this? I've goofed around with the configuration manager and just can't quite get it to work.
0
Comment
Question by:DanteKingsley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22652510
you mean, the ERRORLOG file(s)?
you cannot have them on a different location than mssql installation folder\log ...

only possibility is to mount the log folder to a different drive (requires that you stop sql server)
0
 

Author Comment

by:DanteKingsley
ID: 22653004
Hi Angel,

How do I do that? I can stop or start it anytime I want. Yes, ERRORLOG files. They're eating up the C: so I want to move them to a D: partition.

Can you tell me how to do this?
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 22653023
Official way:

Go to the SQL Server Configuration Manger Under the SQL Server 2005 Services tab find the SQL Server Service --> Right click --> Properties --> Advanced tab.

Find the Startup Parmaters and change the -e Parameter and change the path. The path must be exist already.

Restart the services.
-----------------------------------------
Unofficial way (only recommended for the truly skilled or the really really brave):
Find the
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\Parameters
registry  key and change the "SQLArg1"="-e....." key.
Rester the services.


-dc:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf;-ec:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG;-lc:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf

Open in new window

0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:DanteKingsley
ID: 22653087
lol the truely skilled or brave,

Hi Jimpen,

I've been messing with this and don't see the -e on start up parameters. I have a test server to goof with before I try this on the production box.

Can you give me more advice on this? Do I add -e for the start up parameters?
0
 
LVL 38

Accepted Solution

by:
Jim P. earned 500 total points
ID: 22653244
Below is the dump of my local reg key.

If you have the -d (master DB file location) and the -l (master's log file) then yes, add the -e parameter. Note that if you do this in the configuration manager that the only spaces are in the path names with none between the dashes and the rest.

>> lol the truely skilled or brave,

And that's the really brave. ;-)

And if doing the log file, while you're in the registry, you can change the default backup location by editing the BackupDirectory value in the HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer  key.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer\Parameters]
"SQLArg0"="-dc:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\DATA\\master.mdf"
"SQLArg1"="-ec:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\LOG\\ERRORLOG"
"SQLArg2"="-lc:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\DATA\\mastlog.ldf"

Open in new window

0
 

Author Closing Comment

by:DanteKingsley
ID: 31503516
Thank You so much !!!!!!!!!!!!!!!!!!!!!!! It worked !!!!!
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 22653442
Glad to be of assistance. May all your days get brighter and brighter.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22653696
I see I failed to remember the "obvious" answer here :(
good work, jimpen!
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22653709
do not fret angel....it is the obvious answers that typically escape me as well.  ;)
0
 
LVL 38

Expert Comment

by:Jim P.
ID: 22653948
>> I see I failed to remember the "obvious" answer here :(

Well its either late evening or early morning where you are. You either have had too much Duvel or not enough coffee. ;-)

Been there, done that.
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22653981
I do appreciate the Duvel....
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22654062
sorry for the plenty of <offtopic> here ...
it is indeed late, but no Duvel here (at all). only O-juice ... (maybe that's the problem 8-)
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question