One of SQL 2017’s major new features is the ability to run on Linux in addition to the traditional Windows installation. This raises a number of questions:
- How did Microsoft get SQL to work on a non-Windows platform?
- What are the limitations - if any - of running Microsoft SQL on a non-Windows platform?
- Are Microsoft SQL Editions and Licensing the same for Linux?
- How do I install Microsoft SQL on Linux?
How did they get SQL to run on Linux?
First, it is important to understand that SQL Server is architected in layers. The SQL Server kernel resides on top of an underlying platform layer that abstracts specific hardware details from the SQL Server. Building on top of a platform layer helps make SQL Server portable between different versions of Windows and different hardware architectures.
Earlier versions of SQL (pre-SQL 2005) had limited platforms that were not able to take full advantage of updates to hardware capabilities. For example, when features like NUMA were introduced the existing pre-SQL 2005 platform was not able to take advantage of it.
In SQL 2005 the developers introduced SQLOS, which was a major update to the SQL platform layer that allowed SQL Server to take advantage of NUMA and other hardware optimizations. But SQLOS, sometimes referred to as “SOS”, was designed to only provide better access to the hardware and not provide portability to non-Windows operating systems.
However, Microsoft did have a research project named Drawbridge that provided a way to run a Windows subsystem inside of Linux. By combining the improved SQLOS with Drawbridge’s Windows subsystem Microsoft created a Platform Abstraction Layer (SQLPAL) which allowed SQL Server to run on designated non-Windows operating systems.
Is SQL on Linux the same as SQL on Windows?
The SQL 2017 release notes contain a list of unsupported features and services on Linux, along with known issues - the notes do mention that features will be “increasingly enabled over time”.
As of January 2018 Microsoft has released cumulative update 3, and maintains repositories for updates on supported Linux platforms. Microsoft also maintains a cumulative PDF Overview of SQL Server on Linux.
One thing to note is that SQL Server Management Studio (SSMS) is not supported on Linux, but you can install SSMS on a Windows Computer and access SQL on Linux remotely. Microsoft does provide a mssql-tools package for the Linux command line that contains sqlcmd for queries and bcp for bulk import-export.
Editions and Licensing
SQL 2017 editions are fundamentally the same for Windows and Linux and they compare similarly to the SQL 2016 editions: Enterprise, Standard, Developer, Web and Express. Keep in mind that the Enterprise Edition Client Access Licensing (CAL) is being scaled back as Microsoft moves more fully toward exclusively core based licensing.
SQL license pricing is available online, and no distinction is listed as to whether SQL is hosted on Windows or Linux. Presumably, hosting on Linux avoids Windows OS licensing fees. As always, check with your vendor for the available pricing that is part of your license agreement.
How do I install SQL 2017 on Linux?
- Make sure you meet the hardware prerequisites
Minimal hardware includes 2 GB RAM, 6 GB Disk, and 2 x64-cores at 2 GHz. The file system should be XFS or EXT4, with limited support for remote NFS shares.
- Make sure you are running a supported Linux release:
Red Hat Enterprise Linux 7.3 or 7.4
SUSE Linux Enterprise Server v12 SP2
Note that all Linux versions that are supported as SQL 2017 platforms are available in Azure.
- OS specific installation instructions are available in the links posted in the previous step, but in general the installation is steps are:
- Install the platform specific mssql-server repository
- Refresh repositories
- Install mssql-server
- Configure mssql using “mssql-conf setup”
- Verify the mssql-server daemon is running
- Open any necessary firewall ports
- Install the platform specific mssql-tools repository
- Refresh repositories
- Install mssql-tools
- Add mssql-tools path to your PATH environment variable.
The availability of Microsoft SQL Server on Linux provides a useful new option for database administrators. SQL 2017 can potentially save on Windows license costs and even simplify server administration for primarily Linux based environments that would only use Windows servers as MS SQL hosts.
SQL 2017 does have its limitations. Keep in mind that supported Linux releases are limited, not all SQL Server functionality is available, and you may still need some Windows computers to run MS SQL GUI based management tools.