Solved

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

Posted on 2008-10-06
12
2,821 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 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Date from a string 4 70
Why do I get extra rows when I do inner join? 12 42
Unable to save view in SSMS 21 73
View SQL 2005 Job package 16 70
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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