From e923bc5f9fd10e929f8560a040af40184572d9a6 Mon Sep 17 00:00:00 2001 From: Brent Ozar Date: Mon, 26 Aug 2019 07:33:59 -0700 Subject: [PATCH] 2019-08 Release (#2094) * #2005 sp_Blitz version numbers (#2006) Working on #2005. * #2005 easier merges for versions Putting Version, VersionDate variables on a single line. Closes #2005. * #2010 sp_Blitz paused online index operations (#2011) Add warning for rows in sys.index_resumable_operations. Closes #2010. * Fix collation error. (#2014) * #2015 sp_BlitzCache sorting in Azure SQL DB (#2016) Instead of checking version numbers, look at sys.all_columns for the grant and spill columns. Closes #2015. * #2024 sp_BlitzQueryStore s.is_cursor error (#2025) Changed alias on a temp table to match other nearby aliases. Closes #2024. * First responder consistency check (#1997) * sp_Blitz update compile and runs on MSSQL 2014 * Update sp_Blitz.sql Added @Debug handling - bug found for missing mandatory component * Update sp_Blitz.sql * Update sp_Blitz.sql CheckId familly: 226 - FRK consistency Messages: 2260 - First Responder kit consistency check has been unexpectedly modified (check names) 2261 - First Responder kit consistency check has been unexpectedly modified (dynamic query failure) 2262 - First Responder kit mandatory component called %s is missing 2263 - First Responder kit consistency check has been unexpectedly modified (checks ordering) 2264 - Component %s is not at the minimum version required to run this procedure 2265 - First Responder kit consistency check (Failed dynamic SP call to %s) 2266 - First Responder kit consistency: outdated component (%s) removed "everything ok message" * Resolves almost all Brent's comments except CHAR(92) change removed 2264 - Component %s is not at the minimum version required to run this procedure changed detailled finding message for previous 2264 message Checked compilation on SQL Server 2014 * #1994 sp_Blitz version checking (#2028) Changed wording from "consistency check" to "version check," updated check IDs, removed mandatory scripts. Closes #1994. * #1944 sp_BlitzIndex ignore databases (#2029) Adds new IgnoreDatabases parameter, and skips databases with >100 partitions. Closes #1944. * #2009 sp_BlitzFirst call BC differently (#2030) Use SkipAnalysis = 1, SortOrder = all when calling sp_BlitzCache. Closes #2009. * #2026 sp_BlitzCache show multiple plan count (#2031) Closes #2026. * #2017 sp_Blitz Evaluation Edition expiration check (#2032) Closes #2017. * #2018 sp_BlitzCache arith overflow (#2033) Changing MONEY on totals to BIGINT. Closes #2018. * #2019 sp_BlitzCache air_quote_actual plans (#2034) Closes #2019. * Add END in the right spot for IF @Help = 1 (#2035) The END for IF @Help = 1 was in the wrong place, making the procedure a no-op *unless* you also specify @Help = 1. * #2037 sp_BlitzLock support for AWS RDS (#2038) Skips update stats with options that RDS doesn't support. Closes #2037. * 2019_04_release_prep Bumping version numbers, building installation scripts. * Moved SQL header build outside of If block (#2040) * #2042 implicit transaction troubleshooting (#2043) Clarify warnings in sp_Blitz, sp_BlitzFirst. Closes #2042. * edit hyperlink (#2056) * add @OutputType = 'XML' (#2048) * Update sp_blitzcache to avoid arithmetic overflow errors (#2046) Updated sp_blitzcache to avoid arithmetic overflow errors - tabel definitions had changed to BIGINT but the actual logic in this section still casted values as money which was breaking the ceiling for this on our setup. I've pretty much blanket chantged everything except averages to be bigint and have been running for a few days with no failrues since so looks ok and worth someone who knows what they're doing casting an eye over it! * Update sp_ineachdb.sql (#2061) Added 2 Variables @SQLVersion: This was implemented so that large organizations with SQL Server 2008 and R2 can use this sproc. Currently without this change SQL Server versions 2008 and 2008R2 will error with the following. Msg 208, Level 16, State 1, Procedure sp_ineachdb, Line 176 Invalid object name 'sys.dm_hadr_database_replica_states'. @ServerName: This was added to account for VMware SnapShots at times @@SERVERNAME will either come up NULL or with old server name. CONVERT(sysname, SERVERPROPERTY('ServerName')) is a better option and reduces minor nuisances. Feel free to blend in the code if you feel this brings value to the project. * ignore readable secondaries in sp_blitzcache (#2049) * ignore readable secondaries in sp_blitzcache this is a fix for issue #2027 * Checking for is_primary_replica column In sys.dm_hadr_database_replica_states. * 2019_07 Release Bumping version numbers and updating install scripts. * Set DBOwner after restoring database (#2082) * Default @RestoreDiff = NULL If @RestoreDiff IS NULL and @BackupPathDiff != null: treat RestoreDiff=1 * Set database owner after restore * Revert restorediff change from dev branch * Exclude Readable secondary DBs (#2073) Temp table added (#ReadableDBs) this table is populated with all read intent database id's which is used to filter out these database when querying against dm_exec_requests or sessions with a cross apply against a plan cache function. * #2067 Updating directory "/" fixing to work with URLs (#2071) * Updating directory "/" fixing to work with URLs Also correcting incorrect logging message for fixing @MoveLogDrive slashes * Fixing variable typo Data should be log * #2076 sp_BlitzIndex columnstore to table (#2085) When saving columnstore definitions to table, trim them to 4000 characters to avoid an overflow. Closes #2076. * @2060 sp_BlitzFirst 2TB RAM (#2086) Casting RAM as a BIGINT instead of INT. Closes #2060. * #2053 sp_BlitzIndex ignoring databases (#2087) Strip out CR/LF from @IgnoreDatabases, trim spaces afterwards. Closes #2053. * #2022 sp_BlitzCache disabling air_quote_actuals (#2088) This SQL 2019 & Azure SQL DB feature isn't ready yet, so disabling til Microsoft is ready. Closes #2022. * #2044 sp_Blitz new power mode (#2089) Adds Windows 10's new Ultimate Performance Power Mode, whatever that is. Closes #2044. * #2062 sp_BlitzFirst false alarm on index reorgs (#2091) Filtering for sql_text not like %alter index%'. Closes #2062 with duct tape. * #2052 sp_BlitzCache prioritization (#2092) Fixes bug in AirQuoteActual plans, plus if plan cache is 75% new as of today, raise priority 1 warning. Closes #2052. * #2070 sp_BlitzCache duplicated index count (#2093) Filters index recommendations by spid. Closes #2070. * sp_DatabaseRestore case bug Inconsistent case sensitivity. * 2019-09 release prep Bumping version numbers and dates. --- Deprecated/sp_foreachdb.sql | 1 + sp_AllNightLog.sql | 1 + sp_AllNightLog_Setup.sql | 1 + sp_Blitz.sql | 1 + sp_BlitzBackups.sql | 1 + sp_BlitzCache.sql | 5 +++++ sp_BlitzFirst.sql | 1 + sp_BlitzInMemoryOLTP.sql | 1 + sp_BlitzIndex.sql | 1 + sp_BlitzLock.sql | 1 + sp_BlitzQueryStore.sql | 1 + sp_BlitzWho.sql | 1 + sp_DatabaseRestore.sql | 2 ++ sp_ineachdb.sql | 1 + 14 files changed, 19 insertions(+) diff --git a/Deprecated/sp_foreachdb.sql b/Deprecated/sp_foreachdb.sql index 98300237e..c21c40750 100644 --- a/Deprecated/sp_foreachdb.sql +++ b/Deprecated/sp_foreachdb.sql @@ -35,6 +35,7 @@ AS BEGIN SET NOCOUNT ON; SELECT @Version = '3.8', @VersionDate = '20190922'; + SELECT @Version = '3.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_AllNightLog.sql b/sp_AllNightLog.sql index ce5596fce..1c66e28b5 100644 --- a/sp_AllNightLog.sql +++ b/sp_AllNightLog.sql @@ -31,6 +31,7 @@ BEGIN; SELECT @Version = '3.9', @VersionDate = '20191024'; +SELECT @Version = '3.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_AllNightLog_Setup.sql b/sp_AllNightLog_Setup.sql index ad2cc1a51..da0452f5d 100644 --- a/sp_AllNightLog_Setup.sql +++ b/sp_AllNightLog_Setup.sql @@ -37,6 +37,7 @@ SET NOCOUNT ON; BEGIN; SELECT @Version = '3.9', @VersionDate = '20191024'; +SELECT @Version = '3.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_Blitz.sql b/sp_Blitz.sql index 387174aa3..5602bec3a 100755 --- a/sp_Blitz.sql +++ b/sp_Blitz.sql @@ -38,6 +38,7 @@ AS SELECT @Version = '7.9', @VersionDate = '20191024'; + SELECT @Version = '7.7', @VersionDate = '20190826'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) diff --git a/sp_BlitzBackups.sql b/sp_BlitzBackups.sql index 40cb28450..a563c76f6 100755 --- a/sp_BlitzBackups.sql +++ b/sp_BlitzBackups.sql @@ -24,6 +24,7 @@ AS SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT @Version = '3.9', @VersionDate = '20191024'; + SELECT @Version = '3.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_BlitzCache.sql b/sp_BlitzCache.sql index 6f60fa42a..c8e9996da 100644 --- a/sp_BlitzCache.sql +++ b/sp_BlitzCache.sql @@ -273,6 +273,7 @@ SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT @Version = '7.9', @VersionDate = '20191024'; +SELECT @Version = '7.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) @@ -1032,6 +1033,7 @@ DECLARE @DurationFilter_i INT, @VersionShowsAirQuoteActualPlans BIT, @ObjectFullName NVARCHAR(2000) ; + @VersionShowsAirQuoteActualPlans BIT; IF @SortOrder = 'sp_BlitzIndex' @@ -1132,9 +1134,12 @@ IF EXISTS(SELECT * FROM sys.all_columns WHERE OBJECT_ID = OBJECT_ID('sys.dm_exec ELSE SET @VersionShowsSpills = 0; +/* This new 2019 & Azure SQL DB feature isn't working consistently, so turning it back off til Microsoft gets it ready. + See this Github issue for more details: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2022 IF EXISTS(SELECT * FROM sys.all_columns WHERE OBJECT_ID = OBJECT_ID('sys.dm_exec_query_plan_stats') AND name = 'query_plan') SET @VersionShowsAirQuoteActualPlans = 1; ELSE +*/ SET @VersionShowsAirQuoteActualPlans = 0; IF @Reanalyze = 1 AND OBJECT_ID('tempdb..##BlitzCacheResults') IS NULL diff --git a/sp_BlitzFirst.sql b/sp_BlitzFirst.sql index 9b1eafb88..e917e4195 100644 --- a/sp_BlitzFirst.sql +++ b/sp_BlitzFirst.sql @@ -45,6 +45,7 @@ SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT @Version = '7.9', @VersionDate = '20191024'; +SELECT @Version = '7.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_BlitzInMemoryOLTP.sql b/sp_BlitzInMemoryOLTP.sql index b6b6022b4..aa1c65746 100644 --- a/sp_BlitzInMemoryOLTP.sql +++ b/sp_BlitzInMemoryOLTP.sql @@ -83,6 +83,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI AS DECLARE @ScriptVersion VARCHAR(30); SELECT @ScriptVersion = '1.8', @VersionDate = '20191024'; +SELECT @ScriptVersion = '1.9', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_BlitzIndex.sql b/sp_BlitzIndex.sql index 67de3c882..6aed1a972 100644 --- a/sp_BlitzIndex.sql +++ b/sp_BlitzIndex.sql @@ -41,6 +41,7 @@ SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT @Version = '7.9', @VersionDate = '20191024'; +SELECT @Version = '7.7', @VersionDate = '20190826'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) diff --git a/sp_BlitzLock.sql b/sp_BlitzLock.sql index 8b4c2d36d..c026bf78a 100644 --- a/sp_BlitzLock.sql +++ b/sp_BlitzLock.sql @@ -28,6 +28,7 @@ SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT @Version = '2.9', @VersionDate = '20191024'; +SELECT @Version = '2.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) diff --git a/sp_BlitzQueryStore.sql b/sp_BlitzQueryStore.sql index f92d61232..e02514d7e 100644 --- a/sp_BlitzQueryStore.sql +++ b/sp_BlitzQueryStore.sql @@ -57,6 +57,7 @@ SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT @Version = '3.9', @VersionDate = '20191024'; +SELECT @Version = '3.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN RETURN; diff --git a/sp_BlitzWho.sql b/sp_BlitzWho.sql index b930b9ff9..04237e5a6 100644 --- a/sp_BlitzWho.sql +++ b/sp_BlitzWho.sql @@ -29,6 +29,7 @@ BEGIN SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SELECT @Version = '7.9', @VersionDate = '20191024'; + SELECT @Version = '7.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_DatabaseRestore.sql b/sp_DatabaseRestore.sql index 71d6e361b..595bf15d2 100755 --- a/sp_DatabaseRestore.sql +++ b/sp_DatabaseRestore.sql @@ -27,6 +27,7 @@ ALTER PROCEDURE [dbo].[sp_DatabaseRestore] @OnlyLogsAfter NVARCHAR(14) = NULL, @SimpleFolderEnumeration BIT = 0, @DatabaseOwner sysname = NULL, + @DatabaseOwner SYSNAME = NULL, @Execute CHAR(1) = Y, @Debug INT = 0, @Help BIT = 0, @@ -39,6 +40,7 @@ SET NOCOUNT ON; /*Versioning details*/ SELECT @Version = '7.9', @VersionDate = '20191024'; +SELECT @Version = '7.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_ineachdb.sql b/sp_ineachdb.sql index 60a0b6d2c..85cd63bdd 100644 --- a/sp_ineachdb.sql +++ b/sp_ineachdb.sql @@ -34,6 +34,7 @@ BEGIN SET NOCOUNT ON; SELECT @Version = '2.9', @VersionDate = '20191024'; + SELECT @Version = '2.7', @VersionDate = '20190826'; IF(@VersionCheckMode = 1) BEGIN