Beruflich Dokumente
Kultur Dokumente
01 / 02 / 03 /
An overview of SQL Server Getting the most out of SQL Tools and management
on Linux Server on Linux
04 / 05 /
Tools and services for Conclusion
migrations and upgrades
3
SQL Server 2017 continues the evolution run any type of application including open-
of SQL Server on the platform of your source applications. In this e-book, you’ll
choice, improving and enhancing data get an operational view of this RDBMS,
management and data-driven applications with a focus on leveraging SQL Server
through new capabilities and support for capabilities to deliver powerful insights
more Linux distributions, including Red Hat in ways that open-source developers
Enterprise Linux (RHEL), Ubuntu, and SUSE and IT specialists need and expect. In
Enterprise Linux (SLES), as well as container addition to now-standard features like
platforms like Docker and Kubernetes. advanced analytics and end-to-end
business intelligence, SQL Server 2017
Companies can deploy on the platform—
provides in-memory performance across
or combination of platforms—that makes
workloads, mission-critical high availability,
the most sense for their business. The
and unparalleled security features and
same is true for programming languages,
compliance with privacy regulations such
too. Companies using Oracle, PostgreSQL,
as GDPR, PCI, and HIPAA to protect your
DB2, Sybase, and other systems running
data at rest and in motion—all on your
on Linux can now migrate to the SQL
choice of language and platform.
Server 2017, an industry-leading Relational
Database Management System (RDBMS), Choice across platforms
and use the operating system of their
SQL Server on Windows and Linux share a
choice without the requirement to install
common code base. That is, the SQL Server
Windows Server operating system.
core engine hasn’t been changed to allow
Engineers who are most comfortable with
it to run on Linux. SQL Server introduced
C#, Java, Ruby, or another coding language
a Platform Abstraction Layer (SQLPAL)
can build apps using the best language
that’s responsible for abstraction of calls
and platform for the job, and then host the
and communication between SQL Server
apps on any cloud provider or on-premises
and the underlying operating system. The
server that suits their needs using SQL
host extension is simply a native Linux
Server 2017.
application. Low-level operating systems
SQL Server 2017 is engineered to handle functions are native calls to optimize the
relational and non-relational data, graph input/output (I/O), memory, and CPU
data coming from diverse data sources, and usage. When the host extension starts, it
An overview of SQL Server on Linux 6
1
TPC. “TPC-H Result Highlights HPE Proliant DL380 Gen9.” March 2017.
http://www.tpc.org/3327
An overview of SQL Server on Linux 9
Open-source pricing
Customer story:
Of course, your databases and the data
Ajilius, an Australian startup,
that’s within them are priceless. But that
doesn’t mean that you should be required migrated its PostgreSQL
to break the bank to work with your data.
With SQL Server 2017 on Linux, it’s possible
system to SQL Server on
to realize a lower total cost of ownership the Linux data platform,
(TCO) and quicker return on investment
(ROI) than if you choose a competing
resulting in accelerated
vendor. Required capabilities and features development and cost
are built into SQL Server on Linux, including
in-memory capabilities, security, data savings. This new platform
warehousing, and high availability/disaster is easier to administer and
recovery (HADR) at no extra cost.
hosting expenses are down
Avoiding extra licenses, training time, and
hardware costs will ensure your initial by 30 percent. Plus, they
investment in SQL Server pays off.
can use SQL Server built-in
capabilities to help boost
query performance, improve
security, and increase
availability.
An overview of SQL Server on Linux 10
Use Master;
For guidance on installing SQL Server on GO
Ubuntu and SUSE Linux Enterprise Server, ALTER DATABASE tempdb MODIFY FILE (NAME =
tempdev, FILENAME = ‘/var/opt/mssq1/data/
see the QuickStart guides: Install SQL
tempdb01/tempdb01.mdf’, SIZE =- 1024,
Server and create a database on Ubuntu, FILEGROWTH = 8192 KB) ;
Install SQL Server and create a database GO
on SUSE Linux Enterprise Server. To run ALTER DATABASE tempdb MODIFY FILE (NAME
the SQL Server 2017 container image = templog, FILENAME — ‘/var/opt/mssqIl/
datalog/tempdbOI/tempIog.ldf’, SIZE =
with Docker, you need to pull and run
1024KB , FILEGROWTH = 8192KB );
the mssql-server-linux container image. GO
For details on how to do this, see the
QuickStart guide to Run the SQL Server
2017 container image with Docker.
Getting the most out of SQL Server on Linux 13
Here are some other best practices and Check the compatibility level of your
post-installation options that can help database using the following T-SQL
you maximize performance for database command:
applications that connect to SQL Server
on Linux: ALTER DATABASE YourDBName
SET COMPATIBILITY_LEVEL = 140;
ff To maintain efficient Linux and GO
SQL Scheduling behavior, it’s
recommended to use the ALTER Memory configuration settings
SERVER CONFIGURATION command
ff Use mssql-conf to configure the
to set PROCESS AFFINITY for all the
memory limit and ensure there’s
NUMANODEs and/or CPUs.
enough free physical memory for the
ff To reduce the risk of tempdb Linux operating system.
concurrency slowdowns in high-
Linux OS configuration settings
performance environments,
configure multiple tempdb files ff On multi-node Non-Uniform
according to guidelines found Memory Access (NUMA) installations,
through Microsoft Support. The auto NUMA balancing needs to
automatic tempdb configuration be disabled to allow SQL Server to
feature introduced in SQL Server operate at maximum efficiency on a
2016 doesn’t offer an option to NUMA system.
configure multiple tempdb files
when installing SQL Server on Linux. sysctl -w kernel.numa_balancing=0
Shared storage. All FCIs on Linux or Configure setting for SQL Server
Windows Server require some form of Availability Group on Linux. To create
shared storage. The options available for an availability group on Linux servers, you
shared storage on Linux are iSCSI and need to enable availability groups on each
Network File System (NFS), and Server Linux node with endpoints and certificates.
Message Block (SMB) on Windows Server. Use T-SQL (or the New Availability Group
In a configuration that spans multiple Wizard in SSMS on Windows) to create an
locations, data stored in one datacenter availability group with the desired cluster
must be synchronized across locations. For type. After an availability group is created
default user data and log file locations, the on SQL Server, you’ll also need to create
system databases must always exist at /var/ the corresponding resources in Pacemaker.
opt/mssql/data for all instances. To get started with Availability Groups in
SQL Server 2017 on Linux, see Create and
FCI resource group. The FCI on Linux
configure an availability group for SQL
nodes must be created in a resource group.
Server on Linux.
You can create the FCI resource using the
pcs resource command. After ensuring that Cluster type. For an availability group
the FCI is online, you can issue the normal on Linux, set the cluster type to External
SQL statements using SSMS or sqlcmd. or None. An External type means using
Pacemaker with the availability group while
sudo pcs resource create FCIResourceName None means that there’s no requirement
ocf:mssql:fci op defaults timeout=60s
to use Pacemaker. An External cluster
--group RGName
type with Pacemaker helps you query the
instances of SQL Server in the availability
For further guidance on how to create
group and orchestrate failover to maintain
a SQL Server FCI on Linux, see Microsoft
high availability. A cluster type of None
documentation.
only supports manual failover from a
High availability with Always On primary to a secondary replica and is
Availability Groups primarily targeted for the read-scale out
scenario. For listener connectivity in this
For Always On Availability Groups under
context, you can use an IP address resource
Linux-based SQL Server installations,
created in Pacemaker that can run on any
you’ll want to consider characteristics and
of the nodes. Read more about listener
configuration settings such as:
functionality under Linux.
Getting the most out of SQL Server on Linux 16
Visual Studio Code and SQL Server many modern features such as auto-
extensions completion and syntax highlighting. Based
on Python, mssql-cli uses a preferred
Visual Studio (VS) Code is a code editor
installer program (pip) to install it. Once
redefined and optimized for building
it’s installed, you can launch the tool
and debugging modern web and cloud
from the command line using mssql-cli
applications. VS Code is free and available
--help. As an open-source tool that works
on your favorite platform—Linux, macOS,
across platforms, you can install mssql-cli
and Windows. It has a rich ecosystem of
on Windows, macOS, or Linux. For more
extensions found in the VS Code Extension
information on how to install mssql-cli and
Marketplace.
usage, see documentation on the mssql-cli
The mssql extension for VS Code enables GitHub repository.
you to connect to SQL Server, query with
SQL Server Management Studio (SSMS)
T-SQL statements, and view the results. You
can save results as a JSON or CSV file to Even though SQL Server Management
use the data in your applications with just Studio isn’t made to run on Linux, it can be
a few clicks. While typing T-SQL code, you used—from a Windows server—to manage
get rich T-SQL language features like T-SQL SQL Server instances on Linux OS remotely.
IntelliSense (code completion), syntax SSMS is a powerful database administration
highlighting, linting, code navigation, and tool that can help you back up, restore,
code snippets. view, and edit databases, plus create and
edit T-SQL queries, scripts, and database
You can also use VS Code to establish a
objects. See specific instructions on how to
connection to the SQL Server Integration
use SSMS to connect remotely to your SQL
Services (SSIS) Catalog using an SSIS
Server instance on Linux.
extension, and then use T-SQL statements
to deploy an SSIS project to the SSIS System Center Management Pack
Catalog. (Management Pack)
Data Migration Assistant (DMA) presented through the guided process are
easy to understand and implement.
DMA detects compatibility issues that can
affect database functionality on your new Database Experimentation Assistant
version of SQL Server before you migrate. (DEA)
If issues are detected, DMA can offer
DEA helps in evaluating a targeted version
suggestions on how to address them before
of SQL for upgrade. It’s another important
proceeding. It recommends performance
tool for customers upgrading from previous
and reliability improvements for your target
SQL Server versions (starting 2005 and
environment, including newer features that
above) to any newer version of SQL Server.
are available through a version upgrade.
DEA provides analysis reports such as
The migration workflow helps you migrate
queries metrics for compatibility errors,
database schemas, data and users, server
degraded queries and query plans, and
roles, and SQL Server logins. While the
other workload comparison reports to help
migration of Active Directory (AD) logins is
you upgrade successfully. This tool helps
officially supported by SQL Server 2017 on
you set up automated workload capture
Linux, this requires additional configuration
and replay of production database, perform
for setting up AD logins on SQL Server
statistical analysis on traces collected using
2017 on Linux. (For more information,
both old and new instances, and visualize
see Configuration steps.) Standard SQL
the collected data through analysis report.
Authentication works as expected without
You can install DEA through the Microsoft
any additional setup.
Download Center.
Additionally, Data Migration Services (DMS)
Availability groups as a migration path
simplify the migration of existing on-
premises SQL Server, Oracle, and MySQL For migrating from one datacenter or
databases to Microsoft Azure, whether ecosystem to another, availability group
your target database is SQL Database, replicas offer a way to move quickly without
SQL Database Managed Instance, or SQL shuffling around backups and with minimal
Server on an Azure virtual machine. The downtime. You can use the cross-platform
automated workflow guides you through Always On Availability Group configuration,
the changes you need to make before where part of the replica is on a Windows
performing the migration. The options server and the other replica is on a Linux
Tools and services for migrations and upgrades 23