From c2780ecc01cff53a4e72236522f461cee8eb4a14 Mon Sep 17 00:00:00 2001 From: Andreas Jordan <66946165+andreasjordan@users.noreply.github.com> Date: Sun, 21 Jul 2024 19:19:08 +0200 Subject: [PATCH 1/6] Get-DbaLatchStatistic: Fix division by zero (#9427) --- public/Get-DbaLatchStatistic.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/Get-DbaLatchStatistic.ps1 b/public/Get-DbaLatchStatistic.ps1 index 69d767cb6f..59a48208a0 100644 --- a/public/Get-DbaLatchStatistic.ps1 +++ b/public/Get-DbaLatchStatistic.ps1 @@ -95,7 +95,7 @@ function Get-DbaLatchStatistic { [latch_class], [wait_time_ms] / 1000.0 AS [WaitS], [waiting_requests_count] AS [WaitCount], - Case WHEN SUM ([wait_time_ms]) OVER() = 0 THEN NULL ELSE 100.0 * [wait_time_ms] / SUM ([wait_time_ms]) OVER() END AS [Percentage], + CASE WHEN SUM([wait_time_ms]) OVER() > 0 THEN 100.0 * [wait_time_ms] / SUM([wait_time_ms]) OVER() END AS [Percentage], ROW_NUMBER() OVER(ORDER BY [wait_time_ms] DESC) AS [RowNum] FROM sys.dm_os_latch_stats WHERE [latch_class] NOT IN (N'BUFFER') @@ -105,7 +105,7 @@ function Get-DbaLatchStatistic { CAST (MAX ([W1].[WaitS]) AS DECIMAL(14, 2)) AS [WaitSeconds], MAX ([W1].[WaitCount]) AS [WaitCount], CAST (MAX ([W1].[Percentage]) AS DECIMAL(14, 2)) AS [Percentage], - CAST ((MAX ([W1].[WaitS]) / MAX ([W1].[WaitCount])) AS DECIMAL (14, 4)) AS [AvgWaitSeconds], + CAST (CASE WHEN MAX([W1].[WaitCount]) > 0 THEN MAX([W1].[WaitS]) / MAX([W1].[WaitCount]) END AS DECIMAL (14, 4)) AS [AvgWaitSeconds], CAST ('https://www.sqlskills.com/help/latches/' + MAX ([W1].[latch_class]) as XML) AS [URL] FROM [Latches] AS [W1] INNER JOIN [Latches] AS [W2] From c7df5a92570e3cb6c01eb496bfefa24305db539e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mich=C3=A8le=20Tahay?= <62601152+michele-tahay-kohera@users.noreply.github.com> Date: Sun, 21 Jul 2024 19:20:47 +0200 Subject: [PATCH 2/6] Test-DbaDbRecoveryModel: Fix for instances with case sensitive collation (#9425) --- public/Test-DbaDbRecoveryModel.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/Test-DbaDbRecoveryModel.ps1 b/public/Test-DbaDbRecoveryModel.ps1 index 9a83dafb5d..822b5cbbfe 100644 --- a/public/Test-DbaDbRecoveryModel.ps1 +++ b/public/Test-DbaDbRecoveryModel.ps1 @@ -98,9 +98,9 @@ function Test-DbaDbRecoveryModel { WHEN d.recovery_model = 1 AND drs.last_log_backup_lsn IS NOT NULL THEN 1 ELSE 0 END AS IsReallyInFullRecoveryModel - FROM sys.databases AS D + FROM sys.databases AS d INNER JOIN sys.database_recovery_status AS drs - ON D.database_id = drs.database_id + ON d.database_id = drs.database_id WHERE d.recovery_model = $recoveryCode" if ($Database) { @@ -152,4 +152,4 @@ function Test-DbaDbRecoveryModel { } } } -} \ No newline at end of file +} From 4a576df3e662d1d8ef8f8de8b0c4e997b8713e02 Mon Sep 17 00:00:00 2001 From: Mikey Bronowski Date: Sun, 21 Jul 2024 18:21:31 +0100 Subject: [PATCH 3/6] Typos Update Get-DbaDbccHelp.ps1 (#9424) --- public/Get-DbaDbccHelp.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/Get-DbaDbccHelp.ps1 b/public/Get-DbaDbccHelp.ps1 index f2cdbaaa02..9a53c239d1 100644 --- a/public/Get-DbaDbccHelp.ps1 +++ b/public/Get-DbaDbccHelp.ps1 @@ -47,12 +47,12 @@ function Get-DbaDbccHelp { .EXAMPLE PS C:\> Get-DbaDbccHelp -SqlInstance SQLInstance -Statement FREESYSTEMCACHE -Verbose | Format-List - Runs the command DBCC HELP(FREESYSTEMCACHE) WITH NO_INFOMSGS against the SQL Server instance SQLInstance + Runs the command DBCC HELP(FREESYSTEMCACHE) WITH NO_INFOMSGS against the SQLInstance SQL Server instance. .EXAMPLE - PS C:\> Get-DbaDbccHelp -SqlInstance LensmanSB -Statement WritePage -IncludeUndocumented | Format-List + PS C:\> Get-DbaDbccHelp -SqlInstance SQLInstance -Statement WritePage -IncludeUndocumented | Format-List - Sets TraeFlag 2588 on for session and then runs the command DBCC HELP(WritePage) WITH NO_INFOMSGS against the SQL Server instance SQLInstance + Sets Trace Flag 2588 on for the session and then runs the command DBCC HELP(WritePage) WITH NO_INFOMSGS against the SQLInstance SQL Server instance. #> [CmdletBinding()] @@ -105,4 +105,4 @@ function Get-DbaDbccHelp { } } -} \ No newline at end of file +} From cc036e9d77b0b5bfdfb5900dc54887e7d1b3ac62 Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Sun, 21 Jul 2024 19:36:13 +0200 Subject: [PATCH 4/6] v2.1.21 --- bin/dbatools-index.json | Bin 8893244 -> 8893264 bytes dbatools.psd1 | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dbatools-index.json b/bin/dbatools-index.json index 9cfb0765533fd1ba7ae2f23f4ee60671a98ed62c..df1c5240e96276e77e8cb8f5a2d59aef29f91a12 100644 GIT binary patch delta 601 zcmZw9%QKa60Eh9B6UXt!aUu%wx;v!H=_15&Iqrl)DZJfJp>n?!r}|==u`m|>cE;M; zj7?+w0Tx!)R{o5p$KK+zc^1##(=FE#B8t)lMa!j&iczfGijzn2vUEuaN|aYg^69dY zm7*(3Rhq8qn$ne_OkG!&vUlx`A`|W#@tG4}c8vM=+e$D8p21|}SV`L^SZIgMVX-}G zJn1W5)8Mz$jCZWmGS2FNWi}Qj+~#Dz+GCdd_WC)Ovb|u9>p1q0E8lG#r>fONLZO1S zoq&xTQIjc zgwTj4G@}KrXhSO)Gg36+i@FzkbQCY%bP>F)L0!C4B!LVomWf2U5pkkDxbYS;& z3}a)%P&wlaW8oz@TtR54xdh+Z;+gkU=kMOS^Ec9RC`$+A)Inv-r9;Y5uJV+x!zxgr z-14YMM|4!jRICz}s!YdqLSCIzxqPblX@9FWe>Q!7lPRjmHtC@4Hq+hSEi+ifN(61M zr^`xOQ&!5Fw1#M})o#{;cA43!u_qi!(-E=*rmjEiG~27Oe6tj?*Z=>^BwXKrZMdU7 zF0;Rz%3X;^Z1@qtDO92gK~$p#A%t-nXK)s^s6#y(5J4lF(2N$GLlmtzj|;enHpFlV zm(h+6TtO$U;u@~w25#aOy3mat+(sOCa2LI}hx>SdK0L%DJjN6B<0%ptz#xV&jAwX` zBt|fbF}%P_jAH_mn8GVeV+OC0!Ytlk4)b`61uWtn-s1z7@DXWz!e=Z)_=2xL;*pi~ EKNdjC&j0`b diff --git a/dbatools.psd1 b/dbatools.psd1 index 9193f2c405..e275cf71d5 100644 --- a/dbatools.psd1 +++ b/dbatools.psd1 @@ -11,7 +11,7 @@ RootModule = 'dbatools.psm1' # Version number of this module. - ModuleVersion = '2.1.20' + ModuleVersion = '2.1.21' # ID used to uniquely identify this module GUID = '9d139310-ce45-41ce-8e8b-d76335aa1789' From 45b6b80d77ada387ac56b87ffd8aae1f84b99938 Mon Sep 17 00:00:00 2001 From: Mikey Bronowski Date: Thu, 25 Jul 2024 14:49:38 +0100 Subject: [PATCH 5/6] Update dbatools-buildref-index.json SQL2022 CU14 (#9431) --- bin/dbatools-buildref-index.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/dbatools-buildref-index.json b/bin/dbatools-buildref-index.json index aed16e1f62..bf209caf06 100644 --- a/bin/dbatools-buildref-index.json +++ b/bin/dbatools-buildref-index.json @@ -1,5 +1,5 @@ { - "LastUpdated": "2024-07-10T00:00:00", + "LastUpdated": "2024-07-24T00:00:00", "Data": [ { "Version": "8.0.47", @@ -4725,6 +4725,11 @@ { "Version": "16.0.4131", "KBList": "5040939" + }, + { + "CU": "CU14", + "Version": "16.0.4135", + "KBList": "5038325" } ] } From d7359a0cb7c7410ea96dd25edd4d71ae84613c1b Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Thu, 25 Jul 2024 15:54:58 +0200 Subject: [PATCH 6/6] v2.1.22 --- bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql | 3 ++- dbatools.psd1 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql index dc91c47f67..4fae6f54ec 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql @@ -1,7 +1,7 @@ -- SQL Server 2022 Diagnostic Information Queries -- Glenn Berry --- Last Modified: July 10, 2024 +-- Last Modified: July 24, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -81,6 +81,7 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 16.0.4120.1 CU12 + GDR 4/9/2024 https://support.microsoft.com/en-us/topic/kb5036343-description-of-the-security-update-for-sql-server-2022-cu12-april-9-2024-e11a0715-435f-42be-89ff-4b3d8f9734fc -- 16.0.4125.3 CU13 5/16/2024 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate13 -- 16.0.4131.2 CU13 + GDR 7/9/2024 https://support.microsoft.com/en-us/topic/kb5040939-description-of-the-security-update-for-sql-server-2022-cu13-july-9-2024-16a61a81-926c-46a5-b6c0-edbca541f2f6 +-- 16.0.4135.4 CU14 7/23/2024 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate14 -- What's new in SQL Server 2022 (16.x) -- https://bit.ly/3MJEjR1 diff --git a/dbatools.psd1 b/dbatools.psd1 index e275cf71d5..62d62a356f 100644 --- a/dbatools.psd1 +++ b/dbatools.psd1 @@ -11,7 +11,7 @@ RootModule = 'dbatools.psm1' # Version number of this module. - ModuleVersion = '2.1.21' + ModuleVersion = '2.1.22' # ID used to uniquely identify this module GUID = '9d139310-ce45-41ce-8e8b-d76335aa1789'