You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New installation instructions for SQL Server Agent, setting new master db file location, setting new errorlog location and new enviroment variables for Agent/MasterDB/Errorlogs
Copy file name to clipboardExpand all lines: docs/linux/sql-server-linux-configure-mssql-conf.md
+130Lines changed: 130 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,12 +24,16 @@ ms.workload: "On Demand"
24
24
25
25
|||
26
26
|---|---|
27
+
|[Agent](#agent)| Enable SQL Server Agent |
27
28
|[Collation](#collation)| Set a new collation for SQL Server on Linux. |
28
29
|[Customer feedback](#customerfeedback)| Choose whether or not SQL Server sends feedback to Microsoft. |
29
30
|[Database Mail Profile](#dbmail)| Set the default database mail profile for SQL Server on Linux |
30
31
|[Default data directory](#datadir)| Change the default directory for new SQL Server database data files (.mdf). |
31
32
|[Default log directory](#datadir)| Changes the default directory for new SQL Server database log (.ldf) files. |
33
+
|[Default master database file directory](#masterdatabasedir)| Changes the default directory for the master database files on existing SQL installation.|
34
+
|[Default master database file name](#masterdatabasename)| Changes the name of master database files. |
32
35
|[Default dump directory](#dumpdir)| Change the default directory for new memory dumps and other troubleshooting files. |
36
+
|[Default error log directory](#errorlogdir)| Changes the default directory for new SQL Server ErrorLog, Default Profiler Trace, System Health Session XE and Hekaton Session XE files. |
33
37
|[Default backup directory](#backupdir)| Change the default directory for new backup files. |
34
38
|[Dump type](#coredump)| Choose the type of dump memory dump file to collect. |
* These examples run mssql-conf by specify the full path: **/opt/mssql/bin/mssql-conf**. If you choose to navigate to that path instead, run mssql-conf in the context of the current directory: **./mssql-conf**.
53
57
58
+
## <aid="agent"></a> Enable SQL Server Agent
59
+
60
+
The **sqlagent.enabled** setting enables SQL Server Agent. By default, SQL Server Agent is disabled.
61
+
62
+
To change these settings, use the following steps:
63
+
64
+
1. Enable the SQL Server Agent:
65
+
66
+
```bash
67
+
sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
68
+
```
69
+
70
+
1. Restart the SQL Server service:
71
+
72
+
```bash
73
+
sudo systemctl restart mssql-server
74
+
```
75
+
54
76
## <aid="collation"></a> Change the SQL Server collation
55
77
56
78
The **set-collation** option changes the collation value to any of the supported collations.
@@ -126,6 +148,83 @@ The **filelocation.defaultdatadir** and **filelocation.defaultlogdir** settings
126
148
127
149
1. This command also assumes that a /tmp/log directory exists, and that it is under the user and group **mssql**.
128
150
151
+
152
+
## <aid="masterdatabasedir"></a> Change the default master database file directory location
153
+
154
+
The **filelocation.masterdatafile** and **filelocation.masterlogfile** setting changes the location where the SQL Server engine looks for the master database files. By default, this location is /var/opt/mssql/data.
155
+
To change these settings, use the following steps:
156
+
157
+
1. Create the target directory for new error log files. The following example creates a new **/tmp/masterdatabasedir** directory:
158
+
159
+
```bash
160
+
sudo mkdir /tmp/masterdatabasedir
161
+
```
162
+
163
+
1. Change the owner and group of the directory to the **mssql** user:
164
+
165
+
```bash
166
+
sudo chown mssql /tmp/masterdatabasedir
167
+
sudo chgrp mssql /tmp/masterdatabasedir
168
+
```
169
+
170
+
1. Use mssql-conf to change the default master database directory for the master data and log files with the **set** command:
171
+
172
+
```bash
173
+
sudo /opt/mssql/bin/mssql-conf set filelocation.masterdatafile /tmp/masterdatabasedir/master.mdf
174
+
sudo /opt/mssql/bin/mssql-conf set filelocation.masterlogfile /tmp/masterdatabasedir/masterlog.ldf
## <aid="masterdatabasename"></a> Change the name of master database files.
198
+
199
+
The **filelocation.masterdatafile** and **filelocation.masterlogfile** setting changes the location where the SQL Server engine looks for the master database files. By default, this location is /var/opt/mssql/data. To change these settings, use the following steps:
200
+
201
+
1. Stop the SQL Server service:
202
+
203
+
```bash
204
+
sudo systemctl stop mssql-server
205
+
```
206
+
207
+
1. Use mssql-conf to change the expected master database names for the master data and log files with the **set** command:
208
+
209
+
```bash
210
+
sudo /opt/mssql/bin/mssql-conf set filelocation.masterdatafile /var/opt/mssql/data/masternew.mdf
211
+
sudo /opt/mssql/bin/mssql-conf set filelocation.masterlogfile /var/opt/mssql/data /masterlognew.ldf
212
+
```
213
+
214
+
1. Change the name of the master database data and log files
## <aid="dumpdir"></a> Change the default dump directory location
130
229
131
230
The **filelocation.defaultdumpdir** setting changes the default location where the memory and SQL dumps are generated whenever there is a crash. By default, these files are generated in /var/opt/mssql/log.
@@ -157,6 +256,37 @@ To set up this new location, use the following commands:
157
256
sudo systemctl restart mssql-server
158
257
```
159
258
259
+
## <aid="errorlogdir"></a> Change the default error log file directory location
260
+
261
+
The **filelocation.errorlogfile** setting changes the location where the new error log, default profiler trace, system health session XE and Hekaton session XE files are created. By default, this location is /var/opt/mssql/data.
262
+
To change these settings, use the following steps:
263
+
264
+
1. Create the target directory for new error log files. The following example creates a new **/tmp/logs** directory:
265
+
266
+
```bash
267
+
sudo mkdir /tmp/logs
268
+
```
269
+
270
+
1. Change the owner and group of the directory to the **mssql** user:
271
+
272
+
```bash
273
+
sudo chown mssql /tmp/logs
274
+
sudo chgrp mssql /tmp/logs
275
+
```
276
+
277
+
1. Use mssql-conf to change the default errorlog directory with the **set** command:
278
+
279
+
```bash
280
+
sudo /opt/mssql/bin/mssql-conf set filelocation.errorlogfile /tmp/logs/errorlog
281
+
```
282
+
283
+
1. Restart the SQL Server service:
284
+
285
+
```bash
286
+
sudo systemctl restart mssql-server
287
+
```
288
+
289
+
160
290
## <aid="backupdir"></a> Change the default backup directory location
161
291
162
292
The **filelocation.defaultbackupdir** setting changes the default location where the backup files are generated. By default, these files are generated in /var/opt/mssql/data.
1. To enable SQL Server Agent, follow the step below.
50
+
```bash
51
+
sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
52
+
```
56
53
57
54
1. Restart SQL Server with the following command:
55
+
```bash
56
+
sudo systemctl restart mssql-server
57
+
```
58
58
59
-
```bash
60
-
sudo systemctl restart mssql-server
61
-
```
59
+
> [!NOTE]
60
+
> Starting with SQL Server 2017 CU4, SQL Server Agent is included with the **mssql-server** package and is disabled by default. For Agent set up prior to CU4 visit, [Install SQL Server Agent on Linux](sql-server-linux-setup-sql-agent.md).
The following steps install SQL Server Agent (**mssql-server-agent**) on Linux. The [SQL Server Agent](https://docs.microsoft.com/sql/ssms/agent/sql-server-agent) runs scheduled SQL Server jobs. For information on the features supported for this release of the SQL Server Agent, see the [Release Notes](sql-server-linux-release-notes.md).
23
+
The [SQL Server Agent](https://docs.microsoft.com/sql/ssms/agent/sql-server-agent) runs scheduled SQL Server jobs. Starting with SQL Server 2017 CU4, SQL Server Agent is included with the **mssql-server** package and is disabled by default. For information on the features supported for this release of the SQL Server Agent along with version information, see the [Release Notes](sql-server-linux-release-notes.md).
24
+
25
+
Install/Enable the SQL Server Agent:
26
+
-[For Versions 2017 CU4 and above, Enable the SQL Server Agent](#EnableAgentAfterCU4)
27
+
-[For Versions 2017 CU3 and Below, Install the SQL Server Agent](#InstallAgentBelowCU4)
28
+
29
+
30
+
## <aname="EnableAgentAfterCU4">For Versions 2017 CU4 and above, Enable the SQL Server Agent</a>
31
+
32
+
To enable SQL Server Agent, follow the steps below.
33
+
34
+
```bash
35
+
sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
36
+
sudo systemctl restart mssql-server
37
+
```
24
38
25
39
> [!NOTE]
26
-
> Before installing SQL Server Agent, first [install SQL Server 2017](sql-server-linux-setup.md#platforms). This configures the keys and repositories that you use when you install the **mssql-server-agent** package.
40
+
> If you are upgrading from 2017 CU3 or below with Agent installed, SQL Server Agent will be enabled automatically and previous Agent packages will be uninstalled.
27
41
28
-
Install the SQL Server Agent for your platform:
42
+
## <aname="InstallAgentBelowCU4">For Versions 2017 CU3 and Below, Install the SQL Server Agent</a>
29
43
44
+
> [!NOTE]
45
+
> The install instructions below apply to SQL Server Versions 2017 CU3 and below. Before installing SQL Server Agent, first [install SQL Server 2017](sql-server-linux-setup.md#platforms). This configures the keys and repositories that you use when you install the **mssql-server-agent** package.
46
+
47
+
Install the SQL Server Agent for your platform:
30
48
-[Red Hat Enterprise Linux](#RHEL)
31
49
-[Ubuntu](#ubuntu)
32
50
-[SUSE Linux Enterprise Server](#SLES)
33
51
34
-
## <aname="RHEL">Install on RHEL</a>
52
+
###<aname="RHEL">Install on RHEL</a>
35
53
36
54
Use the following steps to install the **mssql-server-agent** on Red Hat Enterprise Linux.
If you need an offline installation, locate the SQL Server Agent package download in the [Release notes](sql-server-linux-release-notes.md). Then use the same offline installation steps described in the article [Install SQL Server](sql-server-linux-setup.md#offline).
52
70
53
-
## <aname="ubuntu">Install on Ubuntu</a>
71
+
###<aname="ubuntu">Install on Ubuntu</a>
54
72
55
73
Use the following steps to install the **mssql-server-agent** on Ubuntu.
If you need an offline installation, locate the SQL Server Agent package download in the [Release notes](sql-server-linux-release-notes.md). Then use the same offline installation steps described in the article [Install SQL Server](sql-server-linux-setup.md#offline).
72
90
73
-
## <aname="SLES">Install on SLES</a>
91
+
###<aname="SLES">Install on SLES</a>
74
92
75
93
Use the following steps to install the **mssql-server-agent** on SUSE Linux Enterprise Server.
0 commit comments