SQL Server on Linux

SQL Server on Linux

Microsoft SQL Server enables organisations with industry-leading data capabilities with key benefits for Performance, Security and Total cost of ownership. With SQL Server on Linux, you can run the relational database engine on an enterprise Linux ecosystem.

SQL Server on Linux was made possible by introducing Platform Abstraction Layer (PAL) into SQL Server. PAL aligned all operating system specific code in one place and allowed the rest of the code to stay independent of the operating system. PAL is as a result of a Microsoft Research project called Drawbridge. More details can be found in this article.

SQL Server provides an enterprise-ready experience with a familiar experience to Windows users and an industry-leading performance. With the Kubernetes support, Organisations now can take advantage of a simplified deployment, ease of management and big data cluster. SQL Server is currently supported on Red Hat Enterprise Server, SUSE Linux Enterprise Server, and Ubuntu. It also supported running in a container with Docker.

Why Should I Run SQL Server on Linux?

Enterprise Ready: SQL Server on Linux enables a proven platform for enterprise-ready critical features such as High Availability and Disaster Recovery using AlwaysOn Availability group that utilises an open-source cluster mechanism for Linux operating system. AlwaysOn Configuration can also mix nodes with Linux and Windows operating system. AlwaysOn Availability groups can help your applications to meet robust business continuity requirements.

Reduced Operating Cost: Organisations can realise improved Operating costs while using SQL Server on Linux. SQL Server license allows it to be used on Windows, Linux or Docker as required in an architecture. Licensing model is similar across platform and provides SQL Server features in a multi Operating system environment. SQL Server is licensed the same way for both Windows and Linux. You can license SQL Server and then choose that license on the platform of your choice Further, existing licenses can be moved to Linux with no additional cost

Performance: SQL Server performance on Linux should be comparable or better in comparison to running it on Windows operating system.. Also, I would encourage you to go through Microsoft’s released configuration guidelines for SQL Server on Linux.

Simplicity: SQL Server on Linux allows SQL Server DBA’s and Developers to perform their routine task(s) with existing tools and scripts without realising the difference. All core database functionalities that work on Windows are available in Linux as well. However, some SQL Server features that are dependent on Windows functionality will not be available. A list of unsupported features can be found here.

Installation and Maintenance: Command line installation of SQL Server, patches on Linux is comparatively faster than Windows. This allows Enterprises to save costly downtimes. Older versions of SQL Server such as SQL Server 2008 or 2008 R2 can be upgraded to a newer version of SQL Server on Linux without much hassle.

Non-Production environment a Click Away: Utilising docker containers to provision non-production database environment allows developers and DBA’s to perform their testing without delays.

Installing SQL Server on Linux?

Install SQL Server on Ubuntu Linux Platform

Use the following commands to perform the installation:

1) Configure Repository

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2019.list)"

2) Install SQL Server

sudo apt-get update
sudo apt-get install -y mssql-server

3) Run Setup

sudo /opt/mssql/bin/mssql-conf setup

4) Run Setup

systemctl status mssql-server --no-pager

5) Connect to SQL Server instance

Sqlcmd -S localhost -U SA -P “SAPASSWORD”

Installing SQL Server on Red Hat Linux Platform

Use the following commands to perform the installation:

1) Download repository file

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo

2) Install SQL Server

sudo yum install -y mssql-server

3) Run setup

sudo /opt/mssql/bin/mssql-conf setup

4) Verify service

systemctl status mssql-server

5) Configure firewall

sudo firewall-cmd --zone=public --add-port=1433/tcp –permanent
sudo firewall-cmd --reload

6) Install Client components

sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/7/prod.repo

7) Install tools

sudo yum install -y mssql-tools unixODBC-devel

8) Update PATH

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

9) Connect to SQL Server Instance

sqlcmd -S localhost -U SA -P 'YourPassword'

Summary and Next Steps

SQL Server on Linux has many benefits in an enterprise deployment. At WARDY IT Solutions we assist organisations to deploy SQL Server on Linux and help to realise the benefits with increased flexibility and performance, reduced operating cost and enhanced Security. With our migration approach, we are able to perform the required scoping and planning, platform and database migration and mitigate any risk along the migration journey.

Need help migrating your SQL Servers to Linux? Please contact WARDY IT Solutions!