By: Manvendra Singh | Last Updated: 2017-03-13 | Comments (3) | SQL Server on Linux
Microsoft released an update for SQL Server on Linux from CTP 1 to CTP1.1. The upgrade will change the version from 220.127.116.11 to 18.104.22.168. I described the installation steps of SQL Server vNext CTP 1 for Linux in my last tip and in this tip I will let you know how to upgrade to CTP 1.1 for SQL Server vNext on Linux.
Microsoft released its first public preview for SQL Server on Linux on the 16th of November 2016. Recently they have released an update of SQL Server vNext and which is now CTP1.1. You can read the latest release notes of SQL Server vNext on Linux to get more details. The SQL Server engine version for this release is 22.214.171.124 where it was previously 126.96.36.199. You can also get a list of all the known issues of this version of SQL Server in this link. There are also a few new features introduced in this version.
Upgrading SQL Server vNext on Red Hat Linux
Before going ahead, you need to have a Linux box running with SQL Server vNext CTP 1 which we will upgrade to CTP 1.1. I followed the step by step method of Microsoft's online documentation to understand this upgrade. Now let's start the upgrade from SQL Server vNext CTP 1 to CTP 1.1.
First, I would recommend running full backups for of all your user and system databases to keep a copy in case anything goes wrong with the upgrade and we need to restore the databases. As SQL Server vNext is in CTP phase, I assume you do not have anything critical running on this version, so you can skip this step if you want.
Now connect to the Linux server. I connected to the Linux server using the PuTTY application as shown in the below picture.
Now we will check the existing version of SQL Server vNext running on the Linux server. Connect using the sqlcmd utility and execute the below command to get the version details.
#connect to SQL Server. Enter the sa password once you get the password prompt. sqlcmd -S192.168.209.128 -Usa #check installed version of SQL Server once connected to SQL Server. SELECT @@VERSION GO
We can see the installed version below which is SQL Server vNext CTP1 (188.8.131.52).
Type exit to exit the sqlcmd prompt.
Now we will check the available updates of SQL Server for the upgrade. Although this is not necessary to perform, this will give you a better picture and help you understand the process of the upgrade. We will use the yum command line to check the available updates. The yum command allows users and system administrators to easily install, update, remove or search software packages on a system. Run the below command to check for updates.
#check available updates for SQL Server yum check-update mssql-server
We can see one update is available for SQL Server in the below picture which we will use to upgrade SQL Server with the help of this package. The version of this package shows 184.108.40.206-1.
We can also check details by running the below command. This command will give detailed information about the target package.
#check available updates for SQL Server yum info mssql-server
There are two package details as shown below. The first shows what is installed which is SQL Server vNext CTP 1 and the second is for the available CTP 1.1 version. We will run the same command post upgrade to compare the before and after.
The SQL Server upgrade was pending one update from the above step and now we will upgrade the SQL Server in this step. We will use yum command to apply the update. These commands will download the newest package and replace the binaries located under /opt/mssql/. The user generated databases and system databases will not be affected by this operation. It's also a good idea to create backups of your databases just in case. Run the below command to start the update.
#Upgrade SQL Server. sudo yum update mssql-server
Once we will execute this command it will ask for the sudo password. Execution will start and it will ask you to type "y" to proceed. You can also see the package name along with its version details as shown below.
Once you enter "y" to proceed, the package download process will start as shown below.
Once package is downloaded, the upgrade process will start and show a progress bar.
Once the upgrade successfully completes, you will get the below screen with the status showing as complete.
Now the SQL Server has been upgraded from build 220.127.116.11 (SQL Server VNext CTP 1) to 18.104.22.168 (SQL Server vNext CTP 1.1). We can verify it by executing the same command which we executed in Step 3. We can see below the SQL Server version is now 22.214.171.124 (CTP1.1).
We can execute a general query to validate the SQL Server accessibility as well. I just queried the name of all databases was hosted earlier on this instance and we can see the command executed successfully.
As we have updated SQL Server with the latest available package, now we can run the yum info command to check the package details of SQL Server to compare it what was in Step 4. We can see below there is only one package showing the latest version. Earlier there were two packages Step 4, one was showing the installed package and the other was showing what was available.
- Learn more about SQL Server vNext and stay tuned for more tips on this topic.
- Explore more knowledge on SQL Server Database Administration Tips
Last Updated: 2017-03-13
About the author
View all my tips