Skip to content

Commit 4213515

Browse files
committed
Updated environment variables and sqlpackage docs
1 parent fa597fd commit 4213515

10 files changed

Lines changed: 78 additions & 113 deletions

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path": "docs/linux/sql-server-linux-migrate-sqlpackage.md",
5+
"redirect_url": "/sql/linux/sql-server-linux-migrate-ssms",
6+
"redirect_document_id": false
7+
},
38
{
49
"source_path": "docs/linux/sql-server-linux-get-started-tutorial.md",
510
"redirect_url": "/sql/linux/sql-server-linux-overview",

docs/linux/TOC.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939

4040
## [Migrate](sql-server-linux-migrate-overview.md)
4141
### [Restore from Windows](sql-server-linux-migrate-restore-database.md)
42-
### [Export and import a BACPAC with SqlPackage](sql-server-linux-migrate-sqlpackage.md)
43-
### [Export and import a BACPAC with SSMS](sql-server-linux-migrate-ssms.md)
42+
### [Export and import a BACPAC from Windows](sql-server-linux-migrate-ssms.md)
4443
### [Migrate with SQL Server Migration Assistant](sql-server-linux-migrate-ssma.md)
4544
### [Bulk copy with bcp](sql-server-linux-migrate-bcp.md)
4645
### [Load data with (SSIS)](sql-server-linux-migrate-ssis.md)

docs/linux/quickstart-install-connect-docker.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ The following steps increase the memory for Docker for Windows to 4 GB.
6161
1. To run the container image with Docker, you can use the following command from a bash shell (Linux/macOS):
6262

6363
```bash
64-
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -p 1401:1433 -d microsoft/mssql-server-linux
64+
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' -e 'MSSQL_PID=Developer' -p 1401:1433 -d microsoft/mssql-server-linux
6565
```
6666

6767
If you are using Docker for Windows, use the following command from an elevated PowerShell command-prompt:
6868

6969
```PowerShell
70-
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong!Passw0rd>" -p 1401:1433 -d microsoft/mssql-server-linux
70+
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong!Passw0rd>" -e "MSSQL_PID=Developer" -p 1401:1433 -d microsoft/mssql-server-linux
7171
```
7272

7373
> [!NOTE]
@@ -79,6 +79,7 @@ The following steps increase the memory for Docker for Windows to 4 GB.
7979
|-----|-----|
8080
| **-e 'ACCEPT_EULA=Y'** | Set the **ACCEPT_EULA** variable to any value to confirm your acceptance of the [End-User Licensing Agreement](http://go.microsoft.com/fwlink/?LinkId=746388). Required setting for the SQL Server image. |
8181
| **-e 'SA_PASSWORD=\<YourStrong!Passw0rd\>'** | Specify your own strong password that is at least 8 characters and meets [SQL Server's password requirements](../relational-databases/security/password-policy.md). Required setting for the SQL Server image. |
82+
| **-e 'MSSQL_PID=Developer'** | Specifies the edition or product key. In this example, the freely licensed Developer Edition is used for non-production testing. For other values, see [Configure SQL Server settings with environment variables on Linux](sql-server-linux-configure-environment-variables.md). |
8283
| **-p 1401:1433** | Map a TCP port on the host environment (first value) with a TCP port in the container (second value). In this example, SQL Server is listening on TCP 1433 in the container and this is exposed to the port, 1401, on the host. |
8384
| **microsoft/mssql-server-linux** | The SQL Server Linux container image. Unless otherwise specified, this defaults to the **latest** image. |
8485
@@ -100,7 +101,7 @@ The SA account is a system administrator on the SQL Server instance that gets cr
100101
101102
1. Choose a strong password to use for the SA user.
102103
103-
1. Use `docker exec` to run **sqlcmd** to change the password using Transact-SQL.
104+
1. Use `docker exec` to run **sqlcmd** to change the password using Transact-SQL. Replace `<Old Password>` and `<New Password>` with your password values.
104105
105106
> ```bash
106107
> docker exec -it <Container ID> /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<Old Password>' -Q 'ALTER LOGIN SA WITH PASSWORD="<New Password>";'

docs/linux/sql-server-linux-configure-environment-variables.md

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: This topic describes how to use environment variables to configure
66
author: rothja
77
ms.author: jroth
88
manager: jhubbard
9-
ms.date: 05/22/2017
9+
ms.date: 07/17/2017
1010
ms.topic: article
1111
ms.prod: sql-linux
1212
ms.technology: database-engine
@@ -25,31 +25,64 @@ ms.assetid:
2525
---
2626
# Configure SQL Server settings with environment variables on Linux
2727

28-
You can use several different environment variables to configure SQL Server 2017 RC1 on Linux. This topic provides a list of the settings that are configurable using environment variables.
28+
You can use several different environment variables to configure SQL Server 2017 RC1 on Linux. These variables are used in two scenarios:
2929

30-
> [!IMPORTANT]
31-
> At this time, the environment variables only configure [SQL Server running in Docker](sql-server-linux-setup-docker.md). To configure the SQL Server service outside of a Docker scenario, see [Configure SQL Server on Linux with the mssql-conf tool](sql-server-linux-configure-mssql-conf.md).
30+
- Initial unprompted setup with `mssql-conf -n setup` command.
31+
- Configuring a new [SQL Server container in Docker](quickstart-install-connect-docker.md).
32+
33+
> [!TIP]
34+
> If you need to configure SQL Server after these setup scenarios, see [Configure SQL Server on Linux with the mssql-conf tool](sql-server-linux-configure-mssql-conf.md).
3235
3336
## Environment variables
3437

3538
| Environment variable | Description |
3639
|-----|-----|
37-
| **ACCEPT_EULA** | Accept the SQL Server license agreement when set to any value (for example, 'Y'). Used on first install only. |
38-
| **SA_PASSWORD** | Configure the SA user password. Used on first install only. |
40+
| **ACCEPT_EULA** | Accept the SQL Server license agreement when set to any value (for example, 'Y'). |
41+
| **SA_PASSWORD** | Configure the SA user password. |
42+
| **MSSQL_PID** | Set the SQL Server edition or product key. Possible values include: Evaluation, Developer, Express, Web, Standard, Enterprise, or a product key in the form of #####-#####-#####-#####-#####, where '#' is a number or a letter. |
43+
| **MSSQL_LCID** | Sets the language ID to use for SQL Server. For example 1036 is French. |
44+
| **MSSQL_COLLATION** | Sets the default collation for SQL Server. This overrides the default mapping of language id (LCID) to collation. |
45+
| **MSSQL_MEMORY_LIMIT_MB** | Sets the maximum amount of memory SQL Server can use. By default it is 80% of the total physical memory. |
3946
| **MSSQL_TCP_PORT** | Configure the TCP port that SQL Server listens on (default 1433). |
4047
| **MSSQL_IP_ADDRESS** | Set the IP address. Currently, the IP address must be IPv4 style (0.0.0.0). |
41-
| **MSSQL_BACKUP_DIR** | Sets the Default backup directory location. |
48+
| **MSSQL_BACKUP_DIR** | Set the Default backup directory location. |
4249
| **MSSQL_DATA_DIR** | Change the directory where the new SQL Server database data files (.mdf) are created. |
43-
| **MSSQL_LOG_DIR** | Changes the directory where the new SQL Server database log (.ldf) files are created. |
50+
| **MSSQL_LOG_DIR** | Change the directory where the new SQL Server database log (.ldf) files are created. |
4451
| **MSSQL_DUMP_DIR** | Change the directory where SQL Server will deposit the memory dumps and other troubleshooting files by default. |
4552
| **MSSQL_ENABLE_HADR** | Enable Availability Groups. |
4653

47-
## Example
54+
## Example: initial setup
55+
56+
The following example runs **mssql-conf setup** without prompts (`-n`). This mode looks for environment variables to use for configuration. The following environment variables are specified:
57+
58+
- **ACCEPT_EULA** accepts the end user license agreement.
59+
- **MSSSQL_PID** specifies the freely licensed Developer Edition of SQL Server for non-production use.
60+
- **SA_PASSWORD** sets a strong password.
61+
- **MSSQL_TCP_PORT** sets the TCP port that SQL Server listens on to 1234.
62+
63+
```bash
64+
sudo ACCEPT_EULA='Y' MSSQL_PID='Developer' SA_PASSWORD='<YourStrong!Passw0rd>' MSSQL_TCP_PORT=1234 /opt/mssql/bin/mssql-conf -n setup
65+
```
66+
67+
## Example: Docker
68+
69+
The following example docker command uses the following environment variables to create a new SQL Server 2017 container:
70+
71+
- **ACCEPT_EULA** accepts the end user license agreement.
72+
- **MSSSQL_PID** specifies the freely licensed Developer Edition of SQL Server for non-production use.
73+
- **SA_PASSWORD** sets a strong password.
74+
- **MSSQL_TCP_PORT** sets the TCP port that SQL Server listens on to 1234. This means that instead of mapping port 1433 (default) to a host port, the custom TCP port must be mapped with the `-p 1234:1234` command in this example.
75+
76+
If you are running Docker on Linux/macOS, use the following syntax with single quotes:
77+
78+
```bash
79+
docker run -e ACCEPT_EULA=Y -e MSSQL_PID='Developer' -e SA_PASSWORD='<YourStrong!Passw0rd>' -e MSSQL_TCP_PORT=1234 -p 1234:1234 -d microsoft/mssql-server-linux
80+
```
4881

49-
The following docker run command uses **MSSQL_TCP_PORT** to set the TCP port that SQL Server listens on. In this case, the host port mapping must that this new port into consideration. Instead of mapping port 1433 (default) to a host port, the custom TCP port must be mapped (1234 in this example).
82+
If you are running Docker on Windows, use the following syntax with double quotes:
5083

5184
```bash
52-
docker run -e ACCEPT_EULA=Y -e SA_PASSWORD='<YourStrong!Passw0rd>' -e MSSQL_TCP_PORT=1234 -p 1234:1234 -d microsoft/mssql-server-linux
85+
docker run -e ACCEPT_EULA=Y -e MSSQL_PID="Developer" -e SA_PASSWORD="<YourStrong!Passw0rd>" -e MSSQL_TCP_PORT=1234 -p 1234:1234 -d microsoft/mssql-server-linux
5386
```
5487

5588
## Next steps

docs/linux/sql-server-linux-develop-overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ You can also use new command-line tools that are native for Linux. These tools i
7272

7373
- [sqlcmd](../tools/sqlcmd-utility.md)
7474
- [bcp](sql-server-linux-migrate-bcp.md)
75-
- [sqlpackage](sql-server-linux-migrate-sqlpackage.md)
7675
- [mssql-conf](sql-server-linux-configure-mssql-conf.md)
7776

7877
## Next steps

docs/linux/sql-server-linux-migrate-overview.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ For a tutorial on migrating a database with backup and restore, see the followin
4141

4242
It is also possible to export your database to a BACPAC file (a compressed file that contains your database schema and data). If you have a BACPAC file, you can transfer this file to your Linux machine and then import it to SQL Server. For more information, see the following topics:
4343

44-
- [Export and import a database with sqlpackage](sql-server-linux-migrate-sqlpackage.md)
45-
- [Export and import a database with SSMS](sql-server-linux-migrate-ssms.md)
44+
- [Export and import a database with SSMS or SqlPackage.exe](sql-server-linux-migrate-ssms.md)
4645

4746
## Migrate from other database servers
4847
You can migrate databases on other database systems to SQL Server 2017 on Linux. This includes Microsoft Access, DB2, MySQL, Oracle, and Sybase databases. In this scenario, use the SQL Server Management Assistant (SSMA) to automate the migration to SQL Server on Linux. For more information, see [Use SSMA to migrate databases to SQL Server on Linux](sql-server-linux-migrate-ssma.md).

docs/linux/sql-server-linux-migrate-sqlpackage.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

docs/linux/sql-server-linux-migrate-ssms.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
# required metadata
33

4-
title: Export and import a database on Linux with SSMS | Microsoft Docs
4+
title: Export and import a database on Linux | Microsoft Docs
55
description:
66
author: sanagama
77
ms.author: sanagama
88
manager: jhubbard
9-
ms.date: 03/17/2017
9+
ms.date: 07/17/2017
1010
ms.topic: article
1111
ms.prod: sql-linux
1212
ms.technology: database-engine
@@ -23,9 +23,9 @@ ms.assetid: 2210cfc3-c23a-4025-a551-625890d6845f
2323
ms.custom: H1Hack27Feb2017
2424

2525
---
26-
# Export and import a database on Linux with SQL Server Management Studio on Windows
26+
# Export and import a database on Linux with SSMS or SqlPackage.exe on Windows
2727

28-
This topic shows how to use [SQL Server Management Studio (SSMS)](https://msdn.microsoft.com/library/mt238290.aspx) to export and import a database on SQL Server 2017 RC1 on Linux. SSMS is a Windows application, so use SSMS when you have a Windows machine that can connect to a remote SQL Server instance on Linux.
28+
This topic shows how to use [SQL Server Management Studio (SSMS)](https://msdn.microsoft.com/library/mt238290.aspx) and [SqlPackage.exe](https://msdn.microsoft.com/library/hh550080.aspx) to export and import a database on SQL Server 2017 RC1 on Linux. SSMS and SqlPackage.exe are Windows applications, so use this technique when you have a Windows machine that can connect to a remote SQL Server instance on Linux.
2929

3030
You should always install and use the most recent version of SQL Server Management Studio (SSMS) as described in [Use SSMS on Windows to connect to SQL Server on Linux](sql-server-linux-develop-use-ssms.md)
3131

@@ -68,5 +68,22 @@ The *.BACPAC file is successfully created at the location you chose and you are
6868

6969
The *.BACPAC file is imported to create a new database in the target server you specified.
7070

71+
## <a id="sqlpackage"></a> SqlPackage command-line option
72+
73+
It is also possible to use the SQL Server Data Tools (SSDT) command-line tool, [SqlPackage.exe](https://msdn.microsoft.com/library/hh550080.aspx) to export and import BACPAC files.
74+
75+
The following example command exports a BACPAC file:
76+
77+
```bash
78+
SqlPackage.exe /a:Export /ssn:tcp:<your_server> /sdn:<your_database> /su:<username> /sp:<password> /tf:<path_to_bacpac>
79+
```
80+
81+
Use the following command to import database schema and user data from a .BACPAC file:
82+
83+
```bash
84+
SqlPackage.exe /a:Import /tsn:tcp:<your_server> /tdn:<your_database> /tu:<username> /tp:<password> /sf:<path_to_bacpac>
85+
86+
```
87+
7188
## See also
7289
For more information on how to use SSMS, see [Use SQL Server Management Studio](https://msdn.microsoft.com/library/ms174173.aspx).

docs/linux/sql-server-linux-release-notes.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,6 @@ The following sections describe known issues with this release of SQL Server 201
144144
#### Full-Text Search
145145
- Not all filters are available with this release, including filters for Office documents. For a list of supported filters, see [Install SQL Server Full-Text Search on Linux](sql-server-linux-setup-full-text-search.md#filters).
146146

147-
#### SqlPackage
148-
- Using SqlPackage requires specifying an absolute path for files. Using relative paths will map the files under the "/tmp/sqlpackage.\<code\>/system/system32" folder.
149-
150-
- **Resolution**: Use absolute file paths.
151-
152-
- SqlPackage shows the location of files with a "C:\\" prefix.
153-
154147
#### SQL Server Integration Services (SSIS)
155148
You can run SSIS packages on Linux. For more info, see the [blog post announcing SSIS support for Linux](https://blogs.msdn.microsoft.com/ssis/2017/05/17/ssis-helsinki-is-available-in-sql-server-vnext-ctp2-1/). Please note the following known issues with this release.
156149

docs/linux/sql-server-linux-whats-new.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ The RC1 release contains the following improvements and fixes:
2626
- Enabled [Windows Authentication](sql-server-linux-active-directory-authentication.md).
2727
- Enabled [DB Mail](../relational-databases/database-mail/database-mail.md).
2828
- Added IPV6 support.
29+
- Added environment variables for initial SQL Server setup. For more information, see [Configure SQL Server settings with environment variables on Linux](sql-server-linux-configure-environment-variables.md).
30+
- Removed **sqlpackage** from installed binaries. SqlPackage can still be run against Linux remotely from Windows.
2931

3032
## CTP 2.1
3133

0 commit comments

Comments
 (0)