Skip to content

Releases: BrentOzarULTD/SQL-Server-First-Responder-Kit

2020-06-06: Lots of Logging Improvements

06 Jun 11:14
c461609
Compare
Choose a tag to compare

If you're saving the contents of sp_BlitzFirst, sp_BlitzCache, and sp_BlitzWho to tables every 15 minutes, you should definitely install this month's updates. There are several key improvements for you in here to help make it easier to troubleshoot plan cache rollover due to unparameterized queries, plus way easier to gather query plans that are having parameter sniffing problems.

If you're not saving this stuff to table, it's as easy as creating a diagnostic database, and then setting up an Agent job to run this every 15 minutes:

EXEC dbo.sp_BlitzFirst 
  @OutputDatabaseName = 'DBAtools', 
  @OutputSchemaName = 'dbo', 
  @OutputTableName = 'BlitzFirst',
  @OutputTableNameFileStats = 'BlitzFirst_FileStats',
  @OutputTableNamePerfmonStats = 'BlitzFirst_PerfmonStats',
  @OutputTableNameWaitStats = 'BlitzFirst_WaitStats',
  @OutputTableNameBlitzCache = 'BlitzCache',
  @OutputTableNameBlitzWho = 'BlitzWho';

It automatically creates the tables and prunes them to keep just 7 days worth of history by default, and you get tons of useful diagnostic data about why your server was slow last night, and what queries were having parameter sniffing issues around that time.

To get the new version:

Consultant Toolkit Changes

Updated the First Responder Kit with this month's script updates, plus:

sp_Blitz Changes

sp_BlitzCache Changes

  • Improvement: warns about lots of single-use plans in the cache. (#2359, #2390, #2398, thanks Erik Darling.)
  • Fix: May's release broke on SQL Server 2008 & R2 due to a change in the way that 2012 & newer - you know, the versions you're supposed to be running since they're supported - show pages in sys.dm_os_memory_clerks. (#2372, thanks West Seattle Coug.)
  • Fix: wasn't showing queries whose duration exceeded the @MinutesBack setting. For example, if you ran it for @MinutesBack = 15, and a query had been running for hours and just happened to finish in the last 15 minutes, it wouldn't show up. We were using the last_execution_time (date/time) from sys.dm_exec_query_stats, but that records when the query starts, not when it finishes. This also adds a new LastCompletionTime to the sp_BlitzCache output tables - that column will be automatically added (but not backfilled) the next time you run sp_BlitzCache to save to table. (#2377, thanks rrankins and Erik Darling.)
  • Fix: when logging sp_BlitzCache to table, QueryPlanHash wasn't being populated. The column was there, but it was just always null. (#2396)

sp_BlitzFirst Changes

sp_BlitzLock Changes

sp_DatabaseRestore: Fixes Awaiting Your Testing

Users have contributed 3 changes/improvements that need testing before we can get 'em into the dev branch. If you can test these by downloading the code and seeing if they work in your environment, please leave a note on the issue with your thoughts on it, and if a user or two agrees that they're production-worthy, I'll merge 'em in:

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at DBA.StackExchange.com and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.

2020-06-02: Lots of Logging Improvements

02 Jun 17:07
b156506
Compare
Choose a tag to compare

If you're saving the contents of sp_BlitzFirst, sp_BlitzCache, and sp_BlitzWho to tables every 15 minutes, you should definitely install this month's updates. There are several key improvements for you in here to help make it easier to troubleshoot plan cache rollover due to unparameterized queries, plus way easier to gather query plans that are having parameter sniffing problems.

If you're not saving this stuff to table, it's as easy as creating a diagnostic database, and then setting up an Agent job to run this every 15 minutes:

EXEC dbo.sp_BlitzFirst 
  @OutputDatabaseName = 'DBAtools', 
  @OutputSchemaName = 'dbo', 
  @OutputTableName = 'BlitzFirst',
  @OutputTableNameFileStats = 'BlitzFirst_FileStats',
  @OutputTableNamePerfmonStats = 'BlitzFirst_PerfmonStats',
  @OutputTableNameWaitStats = 'BlitzFirst_WaitStats',
  @OutputTableNameBlitzCache = 'BlitzCache',
  @OutputTableNameBlitzWho = 'BlitzWho';

It automatically creates the tables and prunes them to keep just 7 days worth of history by default, and you get tons of useful diagnostic data about why your server was slow last night, and what queries were having parameter sniffing issues around that time.

To get the new version:

Consultant Toolkit Changes

Updated the First Responder Kit with this month's script updates, plus:

sp_Blitz Changes

sp_BlitzCache Changes

  • Improvement: warns about lots of single-use plans in the cache. (#2359, #2390, #2398, thanks Erik Darling.)
  • Fix: May's release broke on SQL Server 2008 & R2 due to a change in the way that 2012 & newer - you know, the versions you're supposed to be running since they're supported - show pages in sys.dm_os_memory_clerks. (#2372, thanks West Seattle Coug.)
  • Fix: wasn't showing queries whose duration exceeded the @MinutesBack setting. For example, if you ran it for @MinutesBack = 15, and a query had been running for hours and just happened to finish in the last 15 minutes, it wouldn't show up. We were using the last_execution_time (date/time) from sys.dm_exec_query_stats, but that records when the query starts, not when it finishes. This also adds a new LastCompletionTime to the sp_BlitzCache output tables - that column will be automatically added (but not backfilled) the next time you run sp_BlitzCache to save to table. (#2377, thanks rrankins and Erik Darling.)
  • Fix: when logging sp_BlitzCache to table, QueryPlanHash wasn't being populated. The column was there, but it was just always null. (#2396)

sp_BlitzFirst Changes

sp_BlitzLock Changes

sp_DatabaseRestore: Fixes Awaiting Your Testing

Users have contributed 3 changes/improvements that need testing before we can get 'em into the dev branch. If you can test these by downloading the code and seeing if they work in your environment, please leave a note on the issue with your thoughts on it, and if a user or two agrees that they're production-worthy, I'll merge 'em in:

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at DBA.StackExchange.com and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.

2020-05-06: We Have Quarantined All the Bugs

06 May 22:35
e34e336
Compare
Choose a tag to compare

We have quarantined all of the bugs. Many of the bugs. Okay, 7 of the bugs. Hey, we actually added more improvements than we fixed bugs this month! My favorite new things are that sp_BlitzIndex @mode = 2 now makes it even easier to do disconnected index tuning just purely inside a spreadsheet, and sp_BlitzCache runs faster on big servers.

The "Deprecated" folder now has versions of sp_Blitz, sp_BlitzCache, and sp_BlitzIndex that work on SQL Server 2005. This isn't new code: it just so happened that during one of my classes, a student asked for a 2005 version, and Oddvar Eikli mentioned that he happened to have all of 'em going back years. He graciously shared the versions that still worked with 2005, so I added 'em in. They aren't updated by any means - they're just here for historical purposes for folks who don't have any other choice. Thanks, Oddvar!

To get the new version:

Consultant Toolkit Changes

Updated the First Responder Kit with this month's script updates, plus:
  • The Indexes M2 tab adds a new Forwarded Fetches column. This is useful if you wanna sort by that descending to find the heaps that need to be rebuilt the most urgently.
  • The Indexes M2 tab's Drop TSql and Create TSql columns now use fully qualified database names, making it even easier to copy/paste commands into a client prescription to tell them what indexes to drop, and give them quick undo scripts.

sp_DatabaseRestore: Fixes Awaiting Your Testing

Users have contributed 3 changes/improvements that need testing before we can get 'em into the dev branch. If you can test these by downloading the code and seeing if they work in your environment, please leave a note on the issue with your thoughts on it, and if a user or two agrees that they're production-worthy, I'll merge 'em in:

sp_Blitz Changes

sp_BlitzCache Changes

  • Improvement: when a plan isn't found in cache, include a link to this DBA.StackExchange.com question so folks understand what could have caused it. (#2347, thanks Ajay Patel.)
  • Improvement: faster memory analysis using sys.dm_os_memory_clerks instead of sys.dm_os_buffer_descriptors. (#2345, thanks Daniel Mrowiec.)
  • Improvement: default output now adds the Remove Plan Handle from Cache column that used to require @expertmode = 1. Makes it easier to teach how to fix parameter sniffing issues. (#2346)
  • Fix: allows installation on Azure SQL Managed Instances. Remember, though, we don't support anything in Azure SQL DB or Managed Instances just because MS can/has changed the DMV contents w/o warning and w/o documentation. If it works, great, if it doesn't, getting compatibility is left as an exercise for the reader. (#2353, thanks agentKnipe and Erik Darling.)

sp_BlitzFirst Changes

  • Improvement: @OutputType = 'Top10' now outputs the top 10 wait types since startup in a screenshot-friendly way, so when I'm doing Twitch streams analyzing your wait stats, I don't have to give you as many instructions. (#2342, thanks Nick Kirby.)
  • Fix: if the SQL Server was renamed without doing it right, the global variable @@ServerName wouldn't be correct, so sp_BlitzFirst wasn't deleting history in the sp_BlitzCache table for this server. We now use SERVERPROPERTY('ServerName') instead. (#2320, thanks Sixten Otto and Adrian Buckman.)
  • Fix: wait stats "per core per hour" number was rounding down to small due to extra division, and it wasn't Joy Division. (#2336)
  • Fix: looks like fileproperty() was showing up as DBCC in sys.dm_exec_requests, causing a false positive that CHECKDB was running. Not too sure about this one since I can't test it easily, but if you find an issue with this, holla at ya boy by creating a new issue with what you've discovered. (#2350)

sp_BlitzIndex Changes

  • Improvement: @mode = 2 now includes a column with Forwarded Fetches. The output to table doesn't, though, because we're not currently doing change detection to see if inserting a new column would break the table. (#2314)
  • Improvement: @mode = 2 now includes fully qualified database names for the drop & create T-SQL so that you can do easier index tuning with the Consultant Toolkit, fully disconnected, and send clients recommendations that they can execute faster. (#2357)
  • Improvement: Obsessive Constraintive: Serial Forcer warning about UDFs now points to an explanation page. (#2340, thanks C.Hambrick.)
  • Fix: now handles identity seed values bigger than bigint, like DECIMAL(38,0). (#2268, thanks jbarnard84.)

sp_BlitzWho Changes

  • Improvement: for Agent jobs, the Program Name column now shows the Agent job name. (#2328, thanks Jerry Hung.)

Live Stream from the Coding Session

Bored? Want to make fun of my code? Here's the recording of the 3-hour live stream when I worked on a few of this month's fixes:

https://youtu.be/7XluE7Gxl3k

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questi...

Read more

2020-03-24: Fixing the Bugs of March

24 Mar 15:15
3e6b2f3
Compare
Choose a tag to compare

In the immortal words of "Orange" Julius Caesar as written by Shake's peer, "Beware the bugs of March." It took us 2,064 years, but we've finally fixed those bugs, plus added a couple of new features.

To get the new version:

Consultant Toolkit Changes

Updated the First Responder Kit with this month's script updates.

sp_AllNightLog Changes

  • Fix: skip databases where ignore_database <> 0 in the backup_worker table. (#2308, thanks Maxiwheat.)

sp_Blitz Changes

  • Fix: don't error out when some databases have numeric roundabort turned on, and a rounding error would normally throw an error. (#2302, thanks DJH.)
  • Fix: bug in full backup check: if msdb.backupset contained backups taken on other servers, we would have included them as successful backups when they really weren't. (#2313, thanks Solomon Rutzky.)
  • Fix: uninstall script now works on case-sensitive collations. (#2307, thanks Protiguous.)

sp_BlitzCache Changes

  • Improvement: added a new check for the UserStore_TokenPerm cache being >10% of the buffer pool. I'm seeing issues out in the wild where this cache has taken over memory and caused SQL Server to be unable to cache any execution plans. This was an issue over a decade ago with SQL 2005, but I've got a SQL Server 2016/2017 client with an open case with Microsoft on it. We'll be adding this same check for sp_Blitz and sp_BlitzFirst. (#2134, thanks Erik Darling.)

sp_BlitzFirst Changes

  • Fix: @FilterPlansByDatabase was throwing an error if you passed in a list of databases (rather than just "user" for the user databases.) (#2311, thanks Sam Carey.)

sp_BlitzLock Changes

  • Improvement: now catches single-query parallelism deadlocks, too. (#2286, thanks Adrian Buckman.)
  • Fix: now works with Amazon RDS SQL Server Express Edition by skipping the sysjobssteps query like we do with Azure SQL DB. (#2317, thanks Ernesto-Ibanez.)

sp_BlitzWho Changes

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at DBA.StackExchange.com and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.

2020-02-17: For Valentine's Day, We Got You Less Bugs

17 Feb 16:36
bb9de6c
Compare
Choose a tag to compare

We spent Valentine's Day removing the bugs from your chocolates. You're welcome.

To get the new version:

sp_Blitz Changes

  • Improvement: removed spaces from documentation file names for easier publishing in an Azure DevOps Server wiki. (#2273, thanks PierreLetter.)
  • Improvement: added new priority 250 data size check. Only shows when @CheckServerInfo = 1. Gives you a quick idea of the size of the server you're dealing with in terms of number of databases and total file size. (#2265)
  • Improvement: updated unsupported-build checks now that SQL Server 2014 SP2 is out of support. (#2293)

sp_BlitzCache Changes

  • Fix: plans will no longer trigger both the nearly-parallel warning if they're already parallel. This would happen when you had a parallel query whose cost had dropped under the Cost Threshold for Parallelism. (#2234, thanks Erik Darling.)
  • Fix: "selects with writes" warning may fire incorrectly for stored procedures. (#2290, thanks Erik Darling.)

sp_BlitzIndex Changes

  • Improvement: suggested index names no longer start with IX_. (#2292, thanks Greg Dodd.)
  • Improvement: indexes with 0 reads and 0 writes are no longer shown by default in mode 0 and 4. Just lowering the distractions so you can focus on the indexes that are really causing problems. (#2280, thanks Erik Darling.)
  • Improvement: unused index warning now also shows the index's number of writes. (#2266, thanks Erik Darling.)
  • Fix: some parts of the output were doubling the size of nvarchar columns, like telling you a column was nvarchar(80) when it was really nvarchar(40). (#2285)
  • Fix: now handles identity values even larger than BIGINTs, going all the way to DECIMAL(38,0). (#2268, thanks JBarnard84.)

sp_BlitzLock Changes

  • Improvement: new @VictimsOnly parameter. If you set it to 1, you only get the deadlock victims. Since all of the queries in a deadlock have the same deadlock graph, this can tighten up your result set by a lot if all you're troubleshooting is the deadlock graph, which is what we're focused on in the Consultant Toolkit. (#2219, thanks Erik Darling.)
  • Improvement: better support for identifying when heaps are deadlocked. (#2219, thanks Erik Darling.)
  • Fix: object names not always populating correctly. (#2282, thanks Erik Darling.)

sp_DatabaseRestore Changes

  • Improvement: removed dependency on Ola Hallengren's maintenance scripts. Ola recently released a version with a new mandatory parameter for his CommandExecute stored proc, which broke sp_DatabaseRestore, and we weren't depending on it for anything complex. (#2269, thanks mKarous for the bug report and Eric Straffen for the code.)

sp_ineachdb Changes

  • Improvement: added @exclude_pattern parameter so you can skip databases like the pattern. Accepts wildcards just like the SQL Server LIKE. (Pull #2272, thanks Aaron Bertrand.)

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at DBA.StackExchange.com and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.

2020-01-23: Improvements all over the place!

23 Jan 19:00
8f1ba14
Compare
Choose a tag to compare

A couple of times a year, I disconnect from the Internet to sit down with a planning book, my Epic Life Quest, and my future task list. I spend time making sure my day-to-day tasks are still prioritized right. When I do that, I often find out that I've lost focus on a particular task, or I've been spending too much time on something. We only get so many hours in a day, and I gotta figure out where I can be the most effective.

For 2020, one of the things I decided was to update the First Responder Kit just once per quarter instead of once per month. At the time, I was thinking to myself, "These scripts are pretty mature. How many changes can really be left to make?" Uh, as it turns out, a lot, as you can see by this month's changelog! So that plan is out the window - let's keep going with monthly releases, hahaha.

Big shout out to the 8 folks who contributed code & issues for this month's release.

To get the new version:

Consultant Toolkit Changes

Updated the First Responder Kit with this month's script updates, plus:
  • Improvement: new Indexes Missing tab with the missing indexes from all databases. Same output as running sp_BlitzIndex @mode = 3, and most of this stuff is available in the Indexes M4 tab, but when you have to do a massive index cleanup, it's helpful to be able to slice & dice these in a table.
  • Fix: sp_BlitzCache memory grant & spill sorts weren't running on Azure SQL DB. (Thanks, Erik.)

sp_Blitz Changes

  • Improvement: added non-default database configs for enable_broker and honor_broker_priority. (#2187, thanks parlevjo2.)
  • Improvement: added more-info query when we catch people running unusual DBCC commands. (#2211)
  • Fix: updated end-of-support dates for unsupported builds check. (#2221, thanks Matt Saunders.)
  • Fix: if you had >50 databases, you'd get the "multiple plans for one query" warning even if you just ran a single query once with sp_MSforeachdb (since it'd put a plan in cache for each query.) If you have >50 databases, we now set the threshold for this warning to be 2x the number of databases. (#2249)

sp_BlitzCache Changes

  • Improvement: new warning for Table Spools. (#2235, thanks Erik Darling.)
  • Improvement: checkid 999 (plan cache is expiring quickly) now has a URL for more details. (#2214)
  • Improvement: the warnings in the 2nd result set now exactly match the warning names in the Warnings column in the top result set, making it easier to look up warnings you don't understand. (#2212)
  • Fix: the stale-statistics check was also labeled checkid 999, so moved that to 997. (#2214)
  • Fix: each time sp_BlitzCache ran, it was putting an insert-into-#ReadableDBs query into the plan cache, which made demos a little cluttered. (#2253)
  • Fix: avoid plan cache pollution by avoiding the use of a random ID when building the output table name. (#2252, thanks Adrian Buckman.)

sp_BlitzFirst Changes

  • Improvement: in @expertmode = 1, added these Availability Groups Perfmon counters (plus a few others) to help troubleshoot high HADR_SYNC_COMMIT waits that aren't related to CPU or storage. I haven't added any alerts for specific thresholds though - just showing these counters in the Perfmon section of the @expertmode = 1 output so you don't have to go setting up a Perfmon session. (#2246)
  • Improvement: if the high forwarded fetches check fires (#29), look in TempDB for the top 10 tables with >100 forwarded fetches, and include them in the results. I would really like to tell you more, but it turns out it's really hard to identify what code & session is responsible for a temp table.  (#2248)
  • Fix: the ##WaitCategories table is no longer repopulated with every run. (#2208, thanks bgpjr.)
  • Fix: error when hitting the long-running blocking check. (#2218, thanks sm8680.)
  • Fix: when @expertmode = 1, really slow sp_BlitzWho runtimes (like for hundreds of sessions rendering across a slow network pipe) would cause sp_BlitzFirst's samples to be shorter since the sp_BlitzWho runtime was included in the sample time. Now the clock only starts after sp_BlitzWho finishes. (#2244)

sp_BlitzIndex Changes

  • Improvement: added @debug parameter that outputs the working temp tables and the dynamic T-SQL used to populate them. (#2229)
  • Fix: if you ran it with @GetAllDatabases = 1, @mode = 3, it would run even if you had >50 databases. Now requires @Bringthepain = 1 even for @mode = 3. (#2255, thanks DBAdminDB.)
  • Fix: non-partitioned columnstore indexes were reporting as partitioned with duplicate row counts. Root cause is multiple rows in sys.dm_db_index_operational_stats for different hobts for the same columnstore index. (#2228)

sp_BlitzLock Changes

sp_BlitzWho Changes

  • Improvement: added OPTION (RECOMPILE) hint, and if the SQL Server has >50GB memory, and it's on a recent patch level, we add a max memory grant hint of 1% to reduce sp_BlitzWho's memory grant request. (#2238, thanks Tara Kizer.)

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at DBA.StackExchange.com and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.

2019-12-02: Bugfixes for the Holidays

02 Dec 18:11
9aa49b6
Compare
Choose a tag to compare

Nothing too dramatic this release, just a few bug fixes and improvements:

sp_BlitzCache Changes

  • Improvement: @Bringthepain = 1 no longer forcibly sets @top to the max. Instead, it's used as a confirmation switch as in the other First Responder Kit procs. For example, if you set @sortorder = 'all' and @top > 10, and you didn't set @SkipAnalysis = 1, then we require you to set @Bringthepain = 1 to make sure you understand that processing will be slow. (#2172)

sp_BlitzFirst Changes

sp_BlitzIndex Changes

  • Improvement: when you run it for table-level details, like sp_BlitzIndex @TableName = 'Users', the first result set with the list of existing indexes has a new last column with the drop T-SQL. Useful for rapidly building undo/redo scripts. (#2177)
  • Fix: when saving the output to table, index definitions longer than 4,000 characters were truncated. Changed output table definition to NVARCHAR(MAX) for the Drop_tsql, Create_tsql, and index_definition columns, and cried just a little. (#2183, thanks Helio Lino de Almeida Filho for the bug report.)

SqlServerVersions Changes

  • Improvement: added SQL Server 2019, updated a few versions. (#2181, thanks sm8680 for the bug report and Emanuele Meazzo for the fix.)

sp_DatabaseRestore Changes Awaiting Review

There are two pull requests with improvements, but I'll be honest: I'm not really qualified to do code review on these because I don't personally use sp_DatabaseRestore. (I just don't have a use for it myself since most of my work focuses on performance tuning.) If you can give these authors a hand by testing it and making notes in the Github issues, we can get these merged into the main branch:

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at DBA.StackExchange.com and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.

2019-10-24: Massive Save-To-Table Improvements

24 Oct 17:49
fd5e1fb
Compare
Choose a tag to compare

This is a pretty doggone big release. There are a lot of improvements to sp_BlitzFirst, sp_BlitzCache, and sp_BlitzWho to prepare for a new release of the First Responder Kit Power BI Dashboard. If you're using that today, I would strongly recommend updating to this new version of the FRK scripts - they fix a ton of bugs and start collecting data in a way that will make joins easier.

Breaking change: if you're logging the data to tables, there's a new JoinKey computed column added to all of the views, and to the BlitzCache, BlitzFirst, and BlitzWho tables to make Power BI Desktop joins easier. These columns will automatically be added by sp_BlitzFirst & friends when you upgrade, but if you're doing any kind of ETL to put all of the Blitz% tables in one central location, you may need to add this column to your central location's tables (and make sure you're not doing SELECT * to ETL the data around.) For questions, feel free to hop into the #FirstResponderKit Slack channel. I'm out on vacation starting Sunday, but I'll stick my head in there from time to time.

To get the new version:

Consultant Toolkit Changes

Updated the First Responder Kit with this month's script updates, plus:
  • Fix: the Plans CPU ByHash tab wasn't populating if the server didn't have sp_BlitzCache installed.

sp_Blitz Changes

  • Fix: new @SkipBlockingChecks parameter defaults to 1. There's a known bug in sys.dm_db_persisted_sku_features, which caused sp_Blitz to be blocked during columnstore index creation. I don't expect Microsoft to fix that one quickly, so we just skip that check by default to be safe. (#2130)
  • Fix: if you stored your database files on a UNC path (\\) and wrote your backups on one too, sp_Blitz no longer reports that you're storing backups in the same place as your databases. (#2141)
  • Fix: some heaps with 0 reads were reported as being actively used. (#2149, thanks Razvan Socol.)

sp_BlitzCache Changes

  • Improvement: @sortorder = 'query hash' now takes a second sort order in a comma-delimited list, like @sortorder = 'query hash, reads' to find the queries with multiple cached plans, sorted by most reads. (#2156)
  • Improvement: adds JoinKey computed column (ServerName + CheckDate) to output table to make Power BI Desktop joins easier. (#2162)
  • Fix: when called by sp_BlitzFirst, the CheckDates in the output table now match the exact same dates/times as sp_BlitzFirst's output tables (even though it's not exactly when sp_BlitzCache is running.) This enables joins in the Power BI Dashboard since we're filtering by dates/times. This used to work back when we only called sp_BlitzCache with a single sort order, based on your top wait type, but once I switched to @sortorder = 'all', it stopped working. (#2159)
  • Fix: when @sortorder = 'all', @MinutesBack was being ignored. This is especially important for folks who use the Power BI Dashboard because with the default Agent job step, this would have resulted in way too much stuff showing up in the plan cache reports, instead of only showing things that executed in the last 15 minutes. (#2168, thanks Matt Rushton.)
  • Fix: in @sortorder = 'all' output, the plans with the most spills were being incorrectly shown in the 'memory grant' category. They were still queries you wanted to fix, but the reason WHY they were a problem was wrong. (#2170, thanks Matt Rushton.)

sp_BlitzFirst Changes

  • Improvement: new @OutputTableNameBlitzWho logs sp_BlitzWho results to table. (#2159)
  • Improvement: new @BlitzCacheSkipAnalysis parameter defaults to 1 to replicate existing behavior, but if you want your sp_BlitzCache output tables to have the full query analysis, you can turn this off in your Agent jobs. I'm not a fan - this makes the Agent job take >30 seconds on even my laptop - but if you want it, there it is. (#2155, thanks Matt Rushton for the idea. The idea is good though!)
  • Improvement: BlitzFirst output table has 2 new columns: JoinKey computed column (ServerName + CheckDate) and QueryHash, plus added join keys to the output views to make Power BI Desktop joins easier. (#2162, #2164)
  • Improvement: added SQL Server 2017 XTP Perfmon counters. (Yes, they actually hard-code the version numbers into the Perfmon counter name, and 2019 uses the 2017 names.) (#2162)
  • Fix: if you passed on a @LogMessage with a @LogMessageCheckDate, we were, uh, ignoring it and just using the current time. (#2135, thanks Matt Rushton.)

sp_BlitzIndex Changes

  • Fix: reducing collation errors. (#2126, thanks chaowlert.)
  • Fix: more natural sorting for missing index recommendations, by impact. (#2143)

sp_BlitzLock Changes

  • Fix: because the system health XE session stores deadlock times in UTC, @StartDate used to assume you knew that. We now assume @StartDate is the server's local time, and we also convert the outputted deadlock dates from UTC to the server's local time too. (#2147, thanks DigitalOhm for the idea.)

sp_BlitzQueryStore Changes

  • Fixes: wasn't running on Azure SQL DB, now does. (#2124 and #2136, thanks Paul McHenry.) Remember, though - our support policy on Azure SQL DB is pretty fast and loose since the DMVs change up there without warning.

sp_BlitzWho Changes

  • Improvement: added a @CheckDateOverride parameter so this can be called by sp_BlitzFirst and write the exact same CheckDates in the output table. This enables joins in the Power BI Dashboard, which requires joins on exact field contents. (#2159)
  • Improvement: adds JoinKey computed column (ServerName + CheckDate) to output table to make Power BI Desktop joins easier. (#2162)

sp_DatabaseRestore Changes

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the <a href="https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener norefe...

Read more

2019-09-22: sp_BlitzCache Caches Up with SQL 2019

22 Sep 05:40
04dd6db
Compare
Choose a tag to compare

sp_Blitz Changes

  • Improvement: added Uninstall.sql for those of you who wanna nuke it from orbit. (#2080, thanks ShawnPOWER for the request and Emanuele Meazzo for the code.)

sp_BlitzCache Changes

sp_BlitzFirst Changes

  • Fix: @CheckProcedureCache was being skipped for some time zones, especially British Standard Time users. I had to fix this before stepping foot on the Isle of Man again, naturally. (#2096, thanks PlanetMatt for the delightfully easy-to-reproduce bug report.)

sp_BlitzIndex Changes

  • Improvement: faster compression analysis on partitioned databases. (#2065, thanks Erik Darling.)

sp_DatabaseRestore Changes

  • Fix: last month's release broke on case-sensitive systems, fixed. (#2097, thanks sm8680 for the bug report.)

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at DBA.StackExchange.com and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.

2019-08-27: Bug Fixes & sp_DatabaseRestore new features

26 Aug 14:41
97bc5e4
Compare
Choose a tag to compare

sp_DatabaseRestore can now restore to Azure blobs and change the database owner after a restore, and everything else gets bug fixes.

To get the new version:

Consultant Toolkit Changes

No functionality changes this month, just updating the First Responder Kit with the below changes.

sp_Blitz Changes

  • Fix: the power mode check now includes the label for Windows 10's new Ultimate Performance Power Mode, which surely goes up to eleven. (#2044, thanks B. Tyler White for the code.)
  • Improvement: added syntax highlighting in the Github repo. (This affects all scripts, not just sp_Blitz.) (#2090, thanks Konstantin Taranov.)

sp_BlitzCache Changes

  • Improvement: if 75% of your plan cache is new as of today, raise the priority on the plan cache time summaries to 1 (instead of 254.) (#2052)
  • Fix: removing air_quote_actual plans for now. This new feature in SQL Server 2019 & Azure SQL DB simply isn't working consistently even in 2019 CTP 3.2, so disabling for now. (#2022, thanks Jonathon Wyza for the bug report and Shane Holder for the debugging.)
  • Fix: skip AG secondary databases that don't allow readable connections. (#2072, thanks Adrian Buckman for the code contribution.)
  • Fix: running sp_BlitzCache from multiple sessions no longer duplicates the missing index count on plans. (#2070)

sp_BlitzFirst Changes

  • Fix: skip AG secondary databases that don't allow readable connections. (#2072, thanks Adrian Buckman for the code contribution.)
  • Fix: was throwing an int overflow on boxes with over 2TB RAM. (#2060, thanks Dan Andrei Stefan for the bug report.)
  • Fix: index reorgs were being reported as DBCC operations due to a bug in sys.dm_exec_requests. (#2062, thanks Erik Darling for the bug report.)

sp_BlitzIndex Changes

  • Fix: when saving sp_BlitzIndex output to table, if you had an index with a definition over 4,000 characters long, it was throwing the legendary data-would-be-truncated error. Could happen if you had a lot of includes with very long column names, or with columnstore indexes. (#2076, thanks Scotti85 for the bug report.)
  • Fix: if the @IgnoreDatabases parameter was broken across multiple lines (like if you copy/pasted from a spreadsheet), they weren't all getting ignored. (#2053, thanks Erik Darling for the bug report.)

sp_DatabaseRestore Changes

  • Improvement: new @DatabaseOwner parameter lets you set the database owner after the restore finishes. (#2081, thanks gdoddsy for the code contribution.)
  • Improvement: ability to restore to an Azure blob target. (#2067, thanks John McCall for the code contribution.)

For Support

When you have questions about how the tools work, talk with the community in the #FirstResponderKit Slack channel. If you need a free invite, hit SQLslack.com. Be patient - it's staffed with volunteers who have day jobs.

When you find a bug or want something changed, read the contributing.md file.

When you have a question about what the scripts found, first make sure you read the "More Details" URL for any warning you find. We put a lot of work into documentation, and we wouldn't want someone to yell at you to go read the fine manual. After that, when you've still got questions about how something works in SQL Server, post a question at DBA.StackExchange.com and the community (that includes us!) will help. Include exact errors and any applicable screenshots, your SQL Server version number (including the build #), and the version of the tool you're working with.