Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one move SQL Server error log files to a new location?

Tags:

sql-server

The default SQL Server log directory is full on my C drive. How does one move the SQL Server error log default directory?

like image 537
qshao Avatar asked Feb 11 '10 21:02

qshao


People also ask

How do I move data and log files in SQL Server?

In SQL Server, you can move system and user databases by specifying the new file location in the FILENAME clause of the ALTER DATABASE statement. Data, log, and full-text catalog files can be moved in this way. This may be useful in the following situations: Failure recovery.

Where are SQL Server error logs located?

By default, the error log is located at Program Files\Microsoft SQL Server\MSSQL. n \MSSQL\LOG\ERRORLOG and ERRORLOG. n files.


2 Answers

Use the SQL Configuration Manager.

Here are the steps to change the startup to use a different directory. Once done restart server:

enter image description here

like image 99
ΩmegaMan Avatar answered Oct 15 '22 20:10

ΩmegaMan


In SSMS go to server properties and look for start up parameters. Right-click in object explorer, properties, then advanced.

The path is the "e" switch. Change and restart.

It can't be set in documented SQL commands :-)

Basically, it's in the registry as one of the parameters to the sqlservr.exe binary when run as a windows service

like image 45
gbn Avatar answered Oct 15 '22 21:10

gbn