SQLskills SQL101: Upgrading to a Different Edition of SQL Server

SQLskills has an ongoing initiative to blog about basic topics, which we’re calling SQL101. We’re all blogging about things that we often see done incorrectly, technologies used the wrong way, or where there are many misunderstandings that lead to serious problems. If you want to find all of our SQLskills SQL101 blog posts, check out SQLskills.com/help/SQL101.

Introduction

A relatively common task that you may have to handle as a database professional is upgrading to a different edition of SQL Server on an existing instance of SQL Server. This is known as an Edition Upgrade, and Microsoft documents the procedure here. This is different than a version upgrade (such as going from SQL Server 2012 to SQL Server 2017).

The two most common scenarios are upgrading from Evaluation Edition to a paid Edition, and upgrading from Standard Edition to Enterprise Edition. There are other possible paths, that are listed for SQL Server 2016 and for SQL Server 2017.

Edition Upgrade Procedure

In order to upgrade the Edition of SQL Server, you will need your SQL Server installation media (which is typically an .iso file). With modern versions of Windows Server you can right-click on the .iso file and select Mount to make the contents of the .iso file available. From the root folder, double-click setup.exe. Once the SQL Server Setup program has loaded (SQL Server Installation Center), click Maintenance, and then select Edition Upgrade.

After a few seconds, you should see the Product Key page as shown in Figure 1. If you are upgrading to a paid edition, you will need a Product Key that will look something like this: 7GPYM-VHN83-PHDM3-Q9T2R-KBV91

License Key

Figure 1: Product Key


Next, you’ll have to accept the license terms, as shown in Figure 2.


image

Figure 2: License Terms


Next, the Edition Upgrade Rules will be checked, as you see in Figure 3.


image

Figure 3: Edition Upgrade Rules

Once the Edition Upgrade Rule check has completed, you can check the details as shown in Figure 4. You will have to resolve any failed rule checks before you can continue.

image

Figure 4: Edition Upgrade Rules Details


Next, you will have to select the instance that you want to upgrade, as shown in Figure 5.


image

Figure 5: Select Instance


Finally, you will see the Ready to upgrade edition screen as shown in Figure 6. You will need to click the Upgrade button to continue.


image

Figure 6: Ready to Upgrade Edition


The Edition Upgrade process usually goes pretty quickly, in a couple of minutes.  The setup program will restart the SQL Server services as part of the installation, so this will cause an outage. In some cases, you may have to also restart the machine that you are running on.




SQLskills SQL101: The Importance of Maintaining SQL Server

SQLskills has an ongoing initiative to blog about basic topics, which we’re calling SQL101. We’re all blogging about things that we often see done incorrectly, technologies used the wrong way, or where there are many misunderstandings that lead to serious problems. If you want to find all of our SQLskills SQL101 blog posts, check out SQLskills.com/help/SQL101.

When I look at many SQL Server instances in the wild, I still see a large percentage of instances that are running extremely old builds of SQL Server for whatever major of version of SQL Server is installed. This is despite years of cajoling and campaigning by myself and many others (such as Aaron Bertrand), and an official guidance change by Microsoft (where they now recommend ongoing, proactive installation of Service Packs and Cumulative Updates as they become available).

Microsoft has a helpful KB article for all versions of SQL Server that explains how to find and download the latest build of SQL Server for each major version:

Where to find information about the latest SQL Server builds

Here is my commentary on where you should try to be for each major recent version of SQL Server:


SQL Server 2017

SQL Server 2017 and newer will use the “Modern Servicing Model”, which does away with Service Packs. Instead, Microsoft will release Cumulative Updates (CU) using a new schedule of one every month for the first year after release, and then one every quarter for next four years after that.

Not only does Microsoft correct product defects in CUs, they also very frequently release new features and other product improvements in CUs. Given that, you should really try to be on the latest CU as soon as you are able to properly test and deploy it.

SQL Server 2017 Build Versions

Performance and Stability Fixes in SQL Server 2017 CU Builds

Reasons to Upgrade to SQL Server 2017


SQL Server 2016

SQL Server 2016 and older use the older “incremental servicing model”, where each new Service Pack is a new baseline (or branch) that has it’s own Cumulative Updates that are released every eight weeks. Microsoft corrects product defects in both Service Packs and in CUs, and they also very frequently release new features and other product improvements in both CUs and Service Packs.

As a special bonus, Microsoft has also gotten into the very welcome habit of actually backporting some features and improvements from newer versions of SQL Server into Service Packs for older versions of SQL Server. The latest example of this was SQL Server 2016 Service Pack 2 which has a number of improvements backported from SQL Server 2017.

SQL Server 2016 Build Versions

Performance and Stability Related Fixes in Post-SQL Server 2016 SP1 Builds

Performance and Stability Related Fixes in Post-SQL Server 2016 SP2 Builds

SQL Server 2016 Service Pack 2 Release Notes

SQL Server 2014

SQL Server 2014 will fall out of Mainstream Support from Microsoft on July 9, 2019. If you are running SQL Server 2014, you really should be on at least SQL Server 2014 SP2 (which got many improvements backported from SQL Server 2016), and ideally, you should be on the latest SP2 Cumulative Update. You should also be on the lookout for SQL Server 2014 SP3 which is due to be released sometime in 2018, which is very likely to have even more backported improvements.

If you are on SQL Server 2014 or SQL Server 2012, Microsoft has a very useful KB article that covers recommended updates and configuration options for high performance workloads. A number of these configuration options are already included if you are on the latest SP or newer for either SQL Server 2012 or SQL Server 2014.

SQL Server 2014 Build Versions

Performance and Stability Related Fixes in Post-SQL Server 2014 SP2 Builds

Hidden Performance and Manageability Improvements in SQL Server 2012/2014

SQL Server 2014 Service Pack 2 is now Available !!!

SQL Server 2012

SQL Server 2012 fell out of Mainstream Support from Microsoft on July 11, 2017. If you are running SQL Server 2012, you really should be on SQL Server 2012 SP4, ideally with the Spectre/Meltdown security update applied on top of SP4. Similar to SQL Server 2014 SP2, SQL Server 2014 SP4 also included a number of product improvements that were backported from SQL Server 2016.

SQL Server 2012 SP3 build versions

Performance and Stability Related Fixes in Post-SQL Server 2012 SP3 Builds

SQL Server 2012 Service Pack 4 (SP4) Released!

So just to recap, here are my recommendations by major version:

SQL Server 2017: Latest CU as soon as you can test and deploy

SQL Server 2016: Latest SP and CU as soon as you can test and deploy. Try to at least be on SQL Server 2016 SP2.

SQL Server 2014: Latest SP and CU as soon as you can test and deploy. Try to at least be on SQL Server 2014 SP2 (and SP3 when it is released).

SQL Server 2012: SP4 plus the security hotfix for Spectre/Meltdown.





SQLskills SQL101: How You Can Make Your Database Backups More Reliable

SQLskills has an ongoing initiative to blog about basic topics, which we’re calling SQL101. We’re all blogging about things that we often see done incorrectly, technologies used the wrong way, or where there are many misunderstandings that lead to serious problems. If you want to find all of our SQLskills SQL101 blog posts, check out SQLskills.com/help/SQL101.

Since my colleague Paul Randal wrote DBCC CHECKDB while he was on the SQL Server Product team at Microsoft, he is an acknowledged expert on SQL Server database corruption and repair techniques. Because of this well-earned reputation, we typically get multiple e-mails each week asking for Paul’s advice and assistance dealing with database corruption and repair issues.

A typical pattern for these e-mails is that a production SQL Server database has become suspect, and running DBCC CHECKDB fails with some specific series of errors. Depending on exactly what errors are being returned from DBCC CHECKDB, it may be a situation where DBCC CHECKDB cannot do anything to resolve the corruption. In some cases, Paul can go in and do some manual repair work (at his regular consulting rate) to help resolve the issue, but in some cases, even Paul cannot fix the corruption (or he is not immediately available to do any work).

This leaves the last line of defense being restoring from your last set of known, good database backups. Unfortunately, in many cases, it turns out that there are no good database backups available that can actually be restored. If this happens, it is likely to be resume/CV updating time for the DBA, and possibly even a catastrophic outcome for the existence of your entire organization. So what can you do to minimize the chance of this happening to you or your organization?

Here are a few steps that you can take:


Keep your main system BIOS and all storage-related firmware and drivers up to date

One of the leading causes of database corruption (and backup corruption) are problems with your storage subsystem. These are often caused by out of date versions of your main system BIOS, storage firmware, or storage drivers. The server and component vendors don’t typically go to the trouble of issuing these types of updates unless they are correcting significant issues.

When these type of updates are available, they are often labeled as critical or urgent updates. Reading the release notes for these updates can often give you more information about the issue and the fix for the issue. As a DBA, you want to make sure someone (perhaps you) is monitoring this situation for your database servers.


Use SQL Server Agent Alerts to detect important errors on your SQL Server instance

Many novice DBAs have never even heard of SQL Server Agent Alerts. In a nutshell, they can be used to more quickly detect and possibly react to some types of hardware and software issues and errors that may happen on a SQL Server instance (or its underlying hardware and storage).

Normally, these types of errors will just get logged to the SQL Server Error Log, where they might not be noticed in a timely manner. Fortunately, I have a T-SQL script that can create a set of SQL Server Agent Alerts for many common issues. I also have a blog post with more details here.


Make sure all of your databases are using CHECKSUM for their Page_Verify option

CHECKSUM is the default page_verify setting for new databases since SQL Server 2005, but you might have older databases that have been upgraded over the years where the page_verify setting was never changed. You also might have a situation where someone has purposely switched the page_verify setting to TORN_PAGE or NONE for some strange reason.

When CHECKSUM is enabled for the PAGE_VERIFY database option, the SQL Server Database Engine calculates a checksum over the contents of the whole page, and stores the value in the page header when a page is written to disk. When the page is read from disk, the checksum is recomputed and compared to the checksum value that is stored in the page header. I previously wrote about this issue here.


Make sure you are using the CHECKSUM option with your database backups

You can (and should) add the CHECKSUM option whenever you run any type of database backup. Since SQL Server 2014, you have had the ability to set an instance-level setting (with sp_configure) to add this option to backup commands by default, just in case someone (or a 3rd party backup solution) does not add the option in the actual backup command. With older versions of SQL Server, you can also get the same effect by adding Trace Flag 3023 as a start-up trace flag You can also enable/disable TF 3023 dynamically.

Adding the CHECKSUM syntax to the backup command forces SQL Server to verify any existing page checksums as it reads pages for the backup, and it calculates a checksum over the entire backup. Adding the CHECKSUM option is not a replacement for actually restoring a database backup to see if it is good or not, but it is a good intermediate step in the process.


Actually restore your database backups on a regular basis to verify that they are good

This is the only way to be absolutely sure that your database backups are good. These other steps will increase the chances that your database backups are good, but an actual database restore is the acid test. You should be doing this on a regular basis, in an automated fashion.

Microsoft has some foundational guidance about backup and restore operations here. Paul Randal has a Pluralsight course called SQL Server: Understanding and Performing Backups.


The whole subject of avoiding database corruption and having an effective database backup and restore strategy to meet your RPO and RTO goals is far more extensive than I want to cover in a single SQL101 blog post. Hopefully the information in this post has been a good starting point.