SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Set New Errorlog File location – SQL Server on Linux

For SQL Server 2017 RTM, the fourth cumulative update was released on 20th February, and it is available for download at the Microsoft Downloads site. It brought a couple of significant improvements like;

Set New Errorlogfile Location

In this blog, I am going to discuss the tip configuring new errorlogfile location on SQL Server on Linux. Let’s follow the below steps to accomplish the relocation of errorlogfile;

  • Verify the current location of SQL Server Error log file on Linux machine

SELECT SERVERPROPERTY('ErrorLogFileName') AS 'Error log file location'

  • Create a newerror folder at “/var/” location and verify it

Syntax: sudo mkdir /var/newerror (It will create the directory newmas)
Syntax: ls -l 

  • Since the created folder is owned by root user & group user, it can’t be accessed by a non-root user. You need to change the ownership of the folder to mssql by running following commands;

Syntax: sudo chown mssql /var/newerror (It changes the user ownership)
Syntax: sudo chgrp mssql /var/newerror (It changes the group user ownership)

  • Fire the below commands to set new errorlog location

Syntax: /opt/mssql/bin/mssql-conf set filelocation.errorlogfile /var/newerror/errorlog

  • Use the following command to STOP the SQL Server service

Syntax: sudo systemctl stop mssql-server

  • START and check the STATUS of SQL Server service

Syntax: sudo systemctl start mssql-server
Syntax: sudo systemctl status mssql-server

  • Verify the new current location of SQL Server Error log file on Linux machine

With the execution of the last step, you have successfully set-up new Errorlogfile location for SQL Server on Linux machine.

The post Set New Errorlog File location – SQL Server on Linux appeared first on .

SQL Geek

Dharmendra is a SQL Server/Microsoft Data Platform professional with over eight years of experience. He enjoys helping others in the SQL Server community and does this by contributing on blogs, speaking at several SQL events. His passion and focus is to explore and share more and more on SQL Server.

Comments

Leave a comment on the original post [www.dharmendrakeshari.com, opens in a new window]

Loading comments...