Solved

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

Posted on 2008-10-06
12
2,806 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
 

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now