Solved

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

Posted on 2008-10-06
12
2,819 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
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 142

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
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.

 

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 142

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 142

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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