6. Install Linux
Install Linux on a physical machine or a virtual machine (VM)
• VirtualBox
• VMware Workstation Player
• Parallel Desktop
• Hyper-V
Or create and use a pre-configured Linux VM in Azure. There is also a
VM image with SQL Server vNext CTP2.0 already installed, see Create a
Linux SQL Server 2017 virtual machine with the Azure portal
2017-09-08 SQL Server on Linux 6
7. Install SQL Server
Supported platforms (installation guide)
• Red Hat Enterprise Linux 7.3 Workstation, Server, and Desktop
• SUSE Linux Enterprise Server v12 SP2
• Ubuntu 16.04LTS and 16.10
• Docker Engine 1.8+ on Windows, Mac, or Linux
2017-09-08 SQL Server on Linux 7
8. Optional Packages
• Red Hat Enterprise Linux
• Ubuntu
• SUSE Enterprise Linux
• macOS
• Docker
Install SQL Server tools
sqlcmd: Command-line query utility
bcp: Bulk import-export utility
2017-09-08 SQL Server on Linux 8
9. Optional Packages
2017-09-08 SQL Server on Linux 9
Install SQL Server Agent
Run scheduled SQL Server jobs
• Red Hat Enterprise Linux
• Ubuntu
• SUSE Enterprise Linux
10. Optional Packages
2017-09-08 SQL Server on Linux 10
Install SQL Server Full-Text Search
full-text queries against character-based data
• Red Hat Enterprise Linux
• Ubuntu
• SUSE Enterprise Linux
11. Optional Packages
2017-09-08 SQL Server on Linux 11
Install SQL Server Integration Services
Run SSIS jobs using DTexec
• Red Hat Enterprise Linux
• Ubuntu
12. Connect and query
2017-09-08 SQL Server on Linux 13
How-to's
• Sqlcmd [tutorial]
• Visual Studio Code (VS Code) [tutorial]
• SQL Server Management Studio (SSMS) [tutorial]
• SQL Server Data Tools (SSDT) [tutorial]
• PowerShell [tutorial]
13. Develop
9/8/2017 SQL Server on Linux 14
Use SQL Server Management Studio
• Install the newest version of SQL
Server Management Studio
14. Connect using sqlcmd on Linux
2017-09-08 SQL Server on Linux 15
# On your Linux box, open a command terminal
# Run sqlcmd with parameters for your SQL Server name (-S), the user name (-U), and the password (-P)
# The following command connects to the local SQL Server instance (localhost) on Linux
sqlcmd -S localhost -U SA -P '<YourPassword>’
# Connect to a remote instance, specify the machine name or IP address for the -S parameter
sqlcmd -S 192.222.2.222 -U SA -P '<YourPassword>'
15. Query SQL Server
2017-09-08 SQL Server on Linux 16
--Returns the name of all of the databases
SELECT Name from sys.Databases;
GO
--Create a database using the SQL Server default settings
CREATE DATABASE Sandbox;
GO
--Use the database
USE Sandbox;
GO
--Create a table in the current database
CREATE TABLE product (id INT, name NVARCHAR(50), quantity INT);
GO
--Insert some data
INSERT INTO product VALUES (1, 'Bottle', 250);
INSERT INTO product VALUES (2, 'Hat', 95);
INSERT INTO product VALUES (3, 'Shirt', 128);
GO
--Select from the table
SELECT * FROM product WHERE quantity > 100;
--End your sqlcmd session, type QUIT
QUIT
17. SQL and Containers
9/8/2017 SQL Server on Linux 18
• Runs on Docker for Windows and
Linux
• Simply pull the “microsoft/mssql-
server-linux” image
• Need to accept the EULA!!!
• Port mapping is important
• Docker run example:
docker run
• -e "ACCEPT_EULA=Y"
• -e "MSSQL_SA_PASSWORD=<password>"
• -e "MSSQL_PID=<edition or product key>
• -p <port mapping>
• --name <dns name>
• -v <local path>:<Docker linux path>
• -d
• <Image name> Run the SQL Server 2017 container image with Docker
20. Develop
2017-09-08 SQL Server on Linux 21
Visual Studio Code
• Download and install VS Code on your machine
• Install the mssql extension
1. Press CTRL+SHIFT+P (or F1) to open the Command Palette in VS Code (for
macOS the Command key is equivalent to the CTRL key on Linux and
Windows)
2. Select Install Extension and type mssql
3. Click install mssql
21. Develop
SQL Server on Linux 22
• Use SQL Server Data Tools
• Install Visual Studio and SQL Server Data Tools*
22. Manage
2017-09-08 SQL Server on Linux 23
• Configure SQL Server on Linux with mssql-conf
• Use SSMS to Manage SQL Server on Linux
• Use PowerShell to Manage SQL Server on Linux
• Create and run jobs
• Use log shipping
23. Migrate
2017-09-08 SQL Server on Linux 24
• Migrate from SQL Server on Windows
Restore a SQL Server database from Windows to Linux
Export and import a database with sqlpackage
Export and import a database with SSMS
• Migrate from other database servers
Use SSMA to migrate databases to SQL Server on Linux
• Migrate structured data
Bulk copy data with bcp
Extract , transform, and load data for SQL Server on Linux with SSIS
24. Business continuity
2017-09-08 SQL Server on Linux 25
Support high-availability and disaster recovery
• Availability Groups
• Database backup and restore
• Failover Cluster Instance
25. Security
2017-09-08 SQL Server on Linux 26
SQL Server on Linux currently has the following limitations:
• SQL Server authentication is available.
• Windows authentication is also supported. Yes Windows!!!
• A standard password policy is provided. MUST_CHANGE is the only option
you may configure.
• Extensible Key Management is not supported.
• Using keys stored in the Azure Key Vault is not supported.
• SQL Server generates its own self-signed certificate for encrypting
connections. Currently, SQL Server cannot be configured to use a user
provided certificate for SSL or TLS.
Get started with security features of SQL Server on Linux
26. Optimize Performance
2017-09-08 SQL Server on Linux 27
Not unique or specific to Linux, but worth exploring:
(Works in SQL Server on Linux!)
• Create a Columnstore Index
• Use In-Memory OLTP
• Use Query Store
• Query Dynamic Management Views
27. Summary
2017-09-08 SQL Server on Linux 28
SQL Server on Linux offers a broader range of choice for all
organizations, not just those who want to run SQL on
Windows. It enables SQL Server to run in more private, public,
and hybrid cloud ecosystems, to be used by developers
regardless of programming languages, frameworks or tools.
28. Resources
2017-09-08 SQL Server on Linux 29
• SQL Server on Linux Documentation
• SQL Server on Linux - Channel 9 (videos)
• SQL Server on Linux - TechNet Virtual Labs
• Developer Getting Started Tutorials
• SQL Server Samples Repository (GitHub)
• SQL developer tools
• Docker Hub - SQL Server on Linux for Docker Engine
29. SQL Server 2017 what’s new
2017-09-08 SQL Server on Linux 30
• Database Engine
• Graph DB
• Adaptive Query Processing
• Automatic tuning
• Support linux
• Scale out read
• SSIS
• Scale out
• Support linux
• SSAS
• New Get Data (Power Query) data sources
• DAX editor
• New Detail Rows end-user action to show details for aggregated info
• SSRS
• Collaboration: Comments are now available for reports including attachment
• ML
• Support Python
1- Provision linux VM (2min)
2- install SQL Server (15min) – Montrer seulement les commandes
3- install SQLcmd + BCP (5min)
4- Query with sqlcmd (5min)
5- Query with SSMS (5min)
6- Backup/restore (10min)
1- Provision linux VM (2min)
2- install SQL Server (15min) – Montrer seulement les commandes
3- install SQLcmd + BCP (5min)
4- Query with sqlcmd (5min)
5- Query with SSMS (5min)
6- Backup/restore (10min)