The latest cloud infrastructure announcements, technical solutions, and enterprise cloud insights.

Microsoft SQL Server Running on Linux Using Oracle Cloud Infrastructure

Niranjan Mohapatra
Principal Solution Architect

Microsoft SQL Server on Linux removes the barrier for organizations that prefer the Linux operating system over Microsoft Windows. It’s the same SQL Server database engine with many similar features; the only difference is the operating system. Currently, Microsoft supports the Linux version of SQL Server on Red Hat Enterprise Linux, SUSE Linux Enterprise Server, and Ubuntu. You can also run SQL Server in a Docker container. You must be able to install, update, and remove SQL Server from the command line.

This post describes how to deploy a SQL Server database running on an Ubuntu Linux server on a single Oracle Cloud Infrastructure Compute VM. It also describes how you can use Oracle Cloud Infrastructure Block Volumes storage to store the SQL Server database files and transaction log files.

Before You Begin

Before you install SQL Server on Linux, consider the following prerequisites:

  • Identify your IOPS or I/O throughput requirements.
  • Check SQL Server documents for resource requirements.
  • Choose an appropriate Oracle Cloud Infrastructure Compute VM shape (OCPU, memory, and storage).
  • Create a secured network on Oracle Cloud Infrastructure to access the SQL Server database.
  • Choose and install a supported Linux server version and its command-line tools.
  • Identify required SQL Server services that must be installed.
  • Generate the SSH key pair and secure the SSH private key and public key.

Choose the Oracle Cloud Infrastructure VM Shape and OS

You can choose the Linux image (Ubuntu) from the Oracle Cloud Infrastructure repository, or you can bring your own Linux image to deploy on the VM. We strongly recommend that you check the Linux server version support on Oracle Cloud Infrastructure before you start deploying. For this post, we chose Ubuntu 16.04 with Debian packages from the Oracle Cloud Infrastructure image repository, and the VM.Standard2.4 shape.

Configure Network Access

Before installing SQL Server, you must create an Oracle Cloud Infrastructure virtual cloud network (VCN) and choose the appropriate availability domain, subnet, and other components for your Linux server. In addition to the existing ingress stateful security rules in your VCN, you might need to add ingress security rules to allow remote SSH (secure shell) access to the Linux server. Ensure that the internet gateway route rules are enabled for internet access, which allows you to access the Linux host over the public network. The following images show the security rule added and route rules enabled to allow SSH access to the Linux host over the public network.

Security list rule:

Route table rule:

For more information about working with security rules and route rules, see the Networking service documentation.

Provision and Connect to the Linux Server

When you provision the Linux (Ubuntu) server, you provide the SSH public key. After the server is provisioned, the following page is displayed in the Console, showing the public IP address to use to access the Linux host.

Use SSH to connect to Linux host, using the username ubuntu and the private key of the SSH key pair. 

Create a Block Storage Volume on Oracle Cloud Infrastructure

We installed the operating system, OS command-line tools, SQL Server binary, and all the required SQL Server tools on the local boot volume. However, we stored the SQL Server database on a block storage volume. The following image illustrates creating a block storage volume on Oracle Cloud Infrastructure and choosing the appropriate backup option (Bronze) for the volume. 

Run the following command on the Ubuntu Linux server as the root user to add the iSCSI target to this block storage volume at the operating-system level.

After you run the preceding commands, you might need to partition the newly added iSCSI storage and create the file system (xfs and ext3 are both supported by SQL Server). The following image shows the mount point of the block storage volume after creating partition, creating appropriate filesystem and mounting the partition.

Install SQL Server on Linux

Follow these steps to install SQL Server on an Ubuntu Linux operating system. Run the following commands in a bash shell of the Ubuntu Linux terminal to install the mssql-server package.

  1. Import the public repository GPG keys:
    sudo wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
  2. Register the SQL Server Ubuntu repository:
    sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"
  3. Install SQL Server on Ubuntu Linux:
    sudo apt-get update

    sudo apt-get install -y mssql-server

  4. Run mssql-confsetup, and set the SA password and choose the SQL Server edition.
    sudo  /opt/mssql/bin/mssql-conf setup

  5. Verify the SQL Server service.
    systemctl  status  mssql-server

  6. Connect to the SQL Server instance.

To create the database, first access the database and connect with a tool that can run Transact-SQL statements on the SQL Server. You might need to install SQL Server Operations Studio, which is a cross-platform GUI database management utility, to manage your MS-SQL Server database.


This post demonstrated how to deploy Microsoft SQL Server on Ubuntu Linux using Oracle Cloud Infrastructure, and discussed how to use Oracle Cloud Infrastructure Block Volumes to store MS-SQL Server database to achieve higher performance and better manageability.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha