SQL Server Diagnostic Information Queries for July 2019

This month, I have just done minor updates to most of the query sets.

I have a T-SQL script that you can use to check whether your instance of SQL Server has been patched to mitigate against the Spectre/Meltdown CPU vulnerability. This works for SQL Server 2008 through SQL Server 2017, for on-premises and cloud-based VM (IaaS) usage. You can get the query for this here.

I often make additional minor updates to the queries periodically during the month, so if you are in doubt, downloading the latest version is always a good idea.

Rather than having a separate blog post for each version, I have just put the links for all ten major versions in this single post. There are two separate links for each version. The first one on the top left is the actual diagnostic query script, and the one below on the right is the matching blank results spreadsheet, with labeled tabs that correspond to each query in the set.

Here are links to the latest versions of these queries for Azure SQL Database, SQL Server 2019, SQL Server 2017, SQL Server 2016 SP2, and SQL Server 2016:


Azure SQL Database Diagnostic Information Queries

Azure SQL Database Blank Results Spreadsheet

SQL Server 2019 Diagnostic Information Queries

SQL Server 2019 Blank Results Spreadsheet

SQL Server 2017 Diagnostic Information Queries

SQL Server 2017 Blank Results Spreadsheet

SQL Server 2016 SP2 Diagnostic Information Queries

SQL Server 2016 SP2 Blank Results Spreadsheet

SQL Server 2016 Diagnostic Information Queries

SQL Server 2016 Blank Results Spreadsheet

 

Here are links to the most recent versions of these scripts for SQL Server 2014 and older:

Since SQL Server 2014 and older are out of Mainstream support from Microsoft (and because fewer of my customers are using these old versions of SQL Server), I am not going to be updating the scripts for these older versions of SQL Server every single month going forward.  SQL Server 2008 R2 and older are also now out of extended support from Microsoft.

I started this policy a while ago, and so far, I have not heard any complaints.

SQL Server 2014 Diagnostic Information Queries

SQL Server 2014 Blank Results Spreadsheet

SQL Server 2012 Diagnostic Information Queries

SQL Server 2012 Blank Results Spreadsheet

SQL Server 2008 R2 Diagnostic Information Queries

SQL Server 2008 R2 Blank Results Spreadsheet

SQL Server 2008 Diagnostic Information Queries

SQL Server 2008 Blank Results Spreadsheet

SQL Server 2005 Diagnostic Information Queries

SQL Server 2005 Blank Results Spreadsheet

The basic instructions for using these queries is that you should run each query in the set, one at a time (after reading the directions for that query). It is not really a good idea to simply run the entire batch in one shot, especially the first time you run these queries on a particular server, since some of these queries can take some time to run, depending on your workload and hardware. I also think it is very helpful to run each query, look at the results (and my comments on how to interpret the results) and think about the emerging picture of what is happening on your server as you go through the complete set. I have quite a few comments and links in the script on how to interpret the results after each query.

After running each query, you need to click on the top left square of the results grid in SQL Server Management Studio (SSMS) to select all of the results, and then right-click and select “Copy with Headers” to copy all of the results, including the column headers to the Windows clipboard. Then you paste the results into the matching tab in the blank results spreadsheet.

About half of the queries are instance specific and about half are database specific, so you will want to make sure you are connected to a database that you are concerned about instead of the master system database. Running the database-specific queries while being connected to the master database is a very common mistake that I see people making when they run these queries.

Note: These queries are stored on Dropbox. I occasionally get reports that the links to the queries and blank results spreadsheets do not work, which is most likely because Dropbox is blocked wherever people are trying to connect. I am not planning on moving these to Github any time soon.

I also occasionally get reports that some of the queries simply don’t work. This usually turns out to be an issue where people have some of their user databases in 80 compatibility mode, which breaks many DMV queries, or that someone is running an incorrect version of the script for their version of SQL Server.

It is very important that you are running the correct version of the script that matches the major version of SQL Server that you are running. There is an initial query in each script that tries to confirm that you are using the correct version of the script for your version of SQL Server. If you are not using the correct version of these queries for your version of SQL Server, some of the queries are not going to work correctly.

If you want to understand how to better run and interpret these queries, you should consider listening to my five related Pluralsight courses, which are SQL Server 2017: Diagnosing Performance Issues with DMVs, SQL Server 2017: Diagnosing Configuration Issues with DMVs, SQL Server 2014 DMV Diagnostic Queries – Part 1SQL Server 2014 DMV Diagnostic Queries – Part 2, and SQL Server 2014 DMV Diagnostic Queries – Part 3. All five of these courses are pretty short and to the point, at 164, 106, 67, 77, and 68 minutes respectively. Listening to these five courses is really the best way to thank me for maintaining and improving these scripts…

Please let me know what you think of these queries, and whether you have any suggestions for improvements. Thanks!

Glenn’s Tech Insights For June 30, 2019

(Glenn’s Tech Insights… used to be part of our bi-weekly newsletter but we decided to make it a regular blog post instead so it can get more visibility. It covers interesting new hardware and software developments that are generally relevant for SQL Server).

Leaked Intel Internal Memo About AMD

There was quite a bit of discussion and commentary last week about a leaked memo from an internal Intel “Circuit News” employee portal. This memo, which is entitled AMD competitive profile: Where we go toe-to-toe, why they are resurgent, which chips of ours beat theirs“. The memo is a pretty frank analysis of Intel’s current challenges in the desktop and server CPU market. Since it was written for internal consumption at Intel, it also seems to be little bit of a “buck up the troops” document, which seems understandable in that context.

The 7nm AMD Ryzen 3000 series processors and new X570 chipset motherboards are going to be on store shelves on July 7, 2019. The review embargos will expire on the same day, so we will probably have many reviews and benchmark numbers from a multitude of reputable 3rd party review sites. That is when we will finally know for sure whether the AMD Ryzen 3000 series processors actually have better single-threaded CPU performance than the best modern Intel processors.

This matters for SQL Server because the upcoming (Q3 2019) AMD 7nm EPYC “Rome” processors use the same Zen 2 architecture as the Ryzen 3000 desktop processors. If Ryzen 3000 lives up to the expectations and hype, that will be a good omen for “Rome”. SQL Server core-based licensing makes single-threaded CPU performance important if you want to maximize CPU performance and capacity while keeping license costs under control. Having a viable alternative to Intel for server processors is good for the market. Strong competition between AMD and Intel will force both companies to continue to innovate at a more rapid pace.

Despite what you may read and hear, Intel is not going to completely fail in those markets. They will lose some market share, and they will probably have to respond by offering lower prices for many of their existing processors. Intel is definitely under pressure in those two market segments, and they just don’t have an announced product release that will be a good competitive response for at least six to twelve months.


Microsoft Releases SQL Server 2019 CTP 3.1

On June 26, 2019, Microsoft released SQL Server 2019 CTP 3.1. The release notes are here. Some of the highlights for the database engine include the ability to have the SQL Server setup program suggest recommended MIN and MAX Server memory values (which you can override) during installation.

SQL Server 2019 CTP 3.1

Figure 1: Memory Configuration During Installation

Another improvement is a new option for indexes, which is OPTIMIZE_FOR_SEQUENTIAL_KEY. This lets you enable an optimization within the database engine that helps improve throughput for high-concurrency inserts into the index. This option is intended for indexes that are prone to last-page insert contention, typically seen with indexes that have a sequential key such as an identity column, sequence, or date/time column.

Microsoft continues to add new features to every SQL Server 2019 CTP release. So far, SQL Server 2019 looks like it is going to be good version release with a lot of genuinely useful new features and improvements compared to SQL Server 2017.


.

How to Uninstall Microsoft SQL Server 2017 Reporting Services

I had to uninstall SQL Server 2017 Reporting Services  (SSRS) for a client recently. It is not difficult to do, but the process is different than it was in older versions of SQL Server. Starting with SQL Server 2017, SSRS 2017 is a separate download from the rest of SQL Server that is not included on the SQL Server 2017 installation media. Because of this, you need to find Microsoft SQL Server Reporting Services under Uninstall or change a program in Control Panel. Then you simply right-click and choose uninstall.

This is different than how it used to be, and different from how Microsoft currently describes it in their documentation, which doesn’t appear to have been updated yet.

Uninstall Reporting Services

SSRS Uninstall 1

Figure 1: Microsoft SQL Server Reporting Services Entry

You will see a screen like this, which will let you do an Edition Upgrade, Repair, or an Uninstall.

SSRS Uninstall 2

Figure 2: Microsoft SQL Server 2017 Reporting Services Maintenance

Depending on your machine, the uninstall should go pretty quickly. It doesn’t typically require a reboot. It also doesn’t require a restart of the SQL Server Service, since it is a completely separate service.

SSRS Uninstall 3

Figure 3: Uninstall in Progress

It will look like this when it is done.

SSRS Uninstall 4

Figure 4: Completed Uninstall

Hopefully this will save you some time if you ever want to do this.