SQL Server – Upgrade – v2017 to v2019/CTP – Linux

Background

Let us upgrade our Microsoft SQL Server v2017 running on Linux.

We will be upgrading it to v2019/RC1.

Outline

  1. Repositories
    • Current Repository
      • List Current Repository files
      • Map Repository Files to Repositories
    • Update Repository
      • Add Repository File for MS SQL Server v2019
  2. Upgrade SQL Server
    • Upgrade SQL Server – Engine
  3. Restart SQL Server Service
  4. Validate Version

Tasks

Repositories

Current Repository

List Current Repository Files

Command
sudo ls /etc/yum.repos.d -la
Output
Output-Image

ls.01.20190907.0834PM

Output-Text
total 60
drwxr-xr-x.   2 root root  279 Nov  4  2018 .
drwxr-xr-x. 144 root root 8192 Aug  2 02:28 ..
-rw-r--r--.   1 root root 1664 Nov 23  2018 CentOS-Base.repo
-rw-r--r--.   1 root root 1309 Nov 23  2018 CentOS-CR.repo
-rw-r--r--.   1 root root  649 Nov 23  2018 CentOS-Debuginfo.repo
-rw-r--r--.   1 root root  314 Nov 23  2018 CentOS-fasttrack.repo
-rw-r--r--.   1 root root  630 Nov 23  2018 CentOS-Media.repo
-rw-r--r--.   1 root root 1331 Nov 23  2018 CentOS-Sources.repo
-rw-r--r--.   1 root root 5701 Nov 23  2018 CentOS-Vault.repo
-rw-r--r--.   1 root root  193 Nov 12  2018 microsoft.repo
-rw-r--r--.   1 root root  193 Dec  1  2018 msprod.repo
-rw-r--r--.   1 root root  193 Dec  4  2018 mssql-release.repo
-rw-r--r--.   1 root root  232 Nov 27  2018 mssql-server.repo

Map Repository Files To Repository

Filename Description
microsoft.repo Microsoft packages for Redhat (rhel) v7
msprod.repo Microsoft packages for Redhat (rhel) v7
mssql-release.repo Microsoft SQL Server Release Repository – Client Tools
mssql-server.repo Microsoft SQL Server Release Repository – Server Tools

Add Repository

Repository

Link

  1. Repository :- Preview (2019)
  2. Name :- mssql-server-preview]
  3. Description :- SQL Server 2019 preview and RC repository.

Add Preview Repository Files

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

addRepository.v2019.01.20190907.0924PM.PNG

Review Added Repository File

Command
sudo cat /etc/yum.repos.d/mssql-server.repo
Output
Output-Image

reviewRepository.v2019.01.20190907.0932PM

Explanation
  1. name :- packages-microsoft-com-mssql-server-preview
  2. baseurl  :- https://packages.microsoft.com/rhel/7/mssql-server-preview/

Upgrade SQL Server

Outline

  1. We are on CentOS
    • yum update mssql-update

Linux – RHEL

Command

sudo yum update mssql-server

Output

Output-Image

upgrade.completed.01.2019097.1111PM

Restart SQL Server Engine

Outline

  1. Restart MS SQL Engine
    • Stop & Start Service
      • Stop MS SQL Server Engine
      • Start MS SQL Server Engine
    • or Restart Service

Tasks

Task – Stop & Start

systemctl
systemctl – Stop

sudo systemctl stop mssql-server

systemctl – Start

sudo systemctl start mssql-server

Task – Restart

systemctl
systemctl – restart

sudo systemctl restart mssql-server

Validate SQL Server Engine

Outline

  1. Using a database query tool
    • Get Version #
      • Get Version Number using “select @@version

Tasks

Get SQL Server Version #

Query

set nocount on;

select
       [@@version] = @@version

Output
Output – Image

validate.version#.01.20190908.1211AM

Output – Text
@@version
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft SQL Server 2019 (RC1) - 15.0.1900.25 (X64)
Aug 16 2019 14:20:53
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Linux (CentOS Linux 7 (Core)) 

References

  1. Microsoft
    • SQL Docs
      • Docs > SQL > SQL Server on Linux > Concepts > Install > Install SQL Server
        • Installation guidance for SQL Server on Linux
          Link
      • Docs > SQL > SQL Server on Linux > Concepts > Install > Configure Repositories
        • Configure repositories for installing and upgrading SQL Server on Linux
          Link

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s