SQL Server Diagnostic Information Queries for January 2016

As I discussed yesterday,  I have done some fairly significant reorganization work for the SQL Server 2016, SQL Server 2014, and SQL Server 2012 versions of these queries this month. I have also made some very minor changes to the SQL Server 2008 R2 and older versions of these queries.

Rather than having a separate blog post for each version, I have just put the links for all six 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 SQL Server 2016, 2014 and 2012:

SQL Server 2016 Diagnostic Information Queries (January 2016)

SQL Server 2016 Blank Results

SQL Server 2014 Diagnostic Information Queries (January 2016)

SQL Server 2014 Blank Results

SQL Server 2012 Diagnostic Information Queries (January 2016)

SQL Server 2012 Blank Results

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

Since SQL Server 2008 R2 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.  I started this policy a while ago, and so far, I have not heard any complaints. I did update these queries this month though.

SQL Server 2008 R2 Diagnostic Information Queries (CY 2016)

SQL Server 2008 R2 Blank Results

SQL Server 2008 Diagnostic Information Queries (CY 2016)

SQL Server 2008 Blank Results

SQL Server 2005 Diagnostic Information Queries (CY 2016)

SQL Server 2005 Blank Results

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 some comments in the script on how to interpret the results after 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 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 three latest Pluralsight courses, which are 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 three of these courses are pretty short and to the point, at 67, 77, and 68 minutes respectively. Listening to these three 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

SQL Server 2014 Service Pack 1 Cumulative Update 4

On December 21, 2015, Microsoft released SQL Server 2014 Service Pack 1 Cumulative Update 4, which is Build 12.0.4436.0. This CU has 34 hotfixes in the public fix list, which is still a fairly substantial number of fixes. This shows that Microsoft has been busy fixing quite a few issues to further improve SQL Server 2014.

If you are still on the SQL Server RTM branch (which I think is a bad thing), Microsoft also released SQL Server 2014 RTM Cumulative Update 11, which is Build 12.0.2560, on the same day.

The official Microsoft build list is available from this KB article:

SQL Server 2014 build versions

This KB article has a lot of very useful information on how to properly configure SQL Server 2012/2014 for the best performance and scalability:

Recommended updates and configuration options for SQL Server 2012 and SQL Server 2014 used with high-performance workloads

SQL Server Diagnostic Query Reorganization

After much thought, and some procrastination, I have decided to implement a fairly significant reorganization of my SQL Server Diagnostic Information Queries, starting with the SQL Server 2016 version for January 2016. I use these queries on a daily basis during my consulting work at SQLskills.com, and I have been planning on making some changes to make them easier for me to use and analyze.

The main thrust of this reorganization effort to to change the order of the queries so that they are grouped more logically, making the results easier to comprehend and analyze. The general ordering is shown below:

  1. Instance-level information
    1. SQL Server configuration details
    2. OS configuration information
    3. Hardware details
    4. Storage details and performance information
    5. Database properties for all databases
    6. Instance-level performance information
  2. Specific database information
    1. File information and usage
    2. Query information
    3. Stored procedure information
    4. Index information
    5. Other performance information

In addition to this, I have revised and improved several of the queries so that they retrieve even more relevant information than before. I am continuing to add additional comments on how to interpret the results, along with additional links to useful sources of additional information about specific queries.

Finally, I have removed a number of queries that I have found to be less useful, taking the overall query count from 76 down to 69 for the SQL Server 2016 version. This will reduce the time required to run the queries and analyze the results.

Here are links to the current version of these queries for SQL Server 2016:

SQL Server 2016 Diagnostic Information Queries (January 2016)

SQL Server 2016 Blank Results

I am also planning on making some formatting changes in some of the queries, so that they work better with Excel.

I am going to make a similar reorganization effort for the SQL Server 2014 and SQL Server 2012 versions of these queries over the next couple of days. I will also make some minor updates to the SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005 versions of the queries for the January release.

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