Skip to content

Commit 55e4798

Browse files
Merge branch 'development'
2 parents ade9f6e + b83e8a5 commit 55e4798

File tree

52 files changed

+3098
-446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3098
-446
lines changed

.github/workflows/gallery.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v3
2323

2424
- name: Install and cache PowerShell modules
25-
uses: potatoqualitee/psmodulecache@v5.2
25+
uses: potatoqualitee/psmodulecache@v6.2.1
2626
with:
2727
modules-to-cache: dbatools.library:2024.4.12
2828

.github/workflows/integration-tests-repl.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v3
1414

1515
- name: Install and cache PowerShell modules
16-
uses: potatoqualitee/psmodulecache@v5.2
16+
uses: potatoqualitee/psmodulecache@v6.2.1
1717
with:
1818
modules-to-cache: dbatools.library:2024.4.12
1919

@@ -63,7 +63,7 @@ jobs:
6363
- uses: actions/checkout@v3
6464

6565
- name: Install and cache PowerShell modules
66-
uses: potatoqualitee/psmodulecache@v5.2
66+
uses: potatoqualitee/psmodulecache@v6.2.1
6767
with:
6868
modules-to-cache: dbatools.library:2024.4.12
6969

@@ -113,7 +113,7 @@ jobs:
113113
- uses: actions/checkout@v3
114114

115115
- name: Install and cache PowerShell modules
116-
uses: potatoqualitee/psmodulecache@v5.2
116+
uses: potatoqualitee/psmodulecache@v6.2.1
117117
with:
118118
modules-to-cache: dbatools.library:2024.4.12
119119

.github/workflows/integration-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v3
2020

2121
- name: Install and cache PowerShell modules
22-
uses: potatoqualitee/psmodulecache@v5.2
22+
uses: potatoqualitee/psmodulecache@v6.2.1
2323
with:
2424
modules-to-cache: dbatools.library:2024.4.12
2525

@@ -68,7 +68,7 @@ jobs:
6868
uses: actions/checkout@v3
6969

7070
- name: Install and cache PowerShell modules
71-
uses: potatoqualitee/psmodulecache@v5.2
71+
uses: potatoqualitee/psmodulecache@v6.2.1
7272
with:
7373
shell: powershell, pwsh
7474
modules-to-cache: dbatools.library:2024.4.12

.github/workflows/xplat-import.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v3
1717

1818
- name: Install and cache PowerShell modules
19-
uses: potatoqualitee/psmodulecache@v5.2
19+
uses: potatoqualitee/psmodulecache@v6.2.1
2020
with:
2121
modules-to-cache: dbatools.library:2024.4.12
2222

bin/dbatools-buildref-index.json

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"LastUpdated": "2024-11-14T00:00:00",
2+
"LastUpdated": "2025-03-01T00:00:00",
33
"Data": [
44
{
55
"Version": "8.0.47",
@@ -4690,6 +4690,21 @@
46904690
"Version": "15.0.4410",
46914691
"KBList": "5046860"
46924692
},
4693+
{
4694+
"CU": "CU30",
4695+
"Version": "15.0.4415",
4696+
"KBList": "5049235"
4697+
},
4698+
{
4699+
"CU": "CU31",
4700+
"Version": "15.0.4420",
4701+
"KBList": "5049296"
4702+
},
4703+
{
4704+
"CU": "CU32",
4705+
"Version": "15.0.4430",
4706+
"KBList": "5054833"
4707+
},
46934708
{
46944709
"Version": "16.0.100",
46954710
"Name": "2022"
@@ -4846,6 +4861,11 @@
48464861
"CU": "CU16",
48474862
"Version": "16.0.4165",
48484863
"KBList": "5048033"
4864+
},
4865+
{
4866+
"CU": "CU17",
4867+
"Version": "16.0.4175",
4868+
"KBList": "5048038"
48494869
}
48504870
]
48514871
}

bin/dbatools-index.json

12.8 KB
Binary file not shown.

bin/diagnosticquery/SQLServerDiagnosticQueries_2005.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
-- SQL Server 2005 Diagnostic Information Queries
33
-- Glenn Berry
4-
-- Last Modified: January 3, 2023
4+
-- Last Modified: January 1, 2025
55
-- https://glennsqlperformance.com/
66
-- https://sqlserverperformance.wordpress.com/
77
-- YouTube: https://bit.ly/2PkoAM1
8-
-- Twitter: GlennAlanBerry
8+
-- Blue Sky: https://bsky.app/profile/glennalanberry.bsky.social
99

1010
-- Diagnostic Queries are available here
1111
-- https://glennsqlperformance.com/resources/
@@ -14,7 +14,7 @@
1414
-- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server
1515

1616
--******************************************************************************
17-
--* Copyright (C) 2023 Glenn Berry
17+
--* Copyright (C) 2025 Glenn Berry
1818
--* All rights reserved.
1919
--*
2020
--*

bin/diagnosticquery/SQLServerDiagnosticQueries_2008.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
-- SQL Server 2008 Diagnostic Information Queries
33
-- Glenn Berry
4-
-- Last Modified: March 6, 2024
4+
-- Last Modified: January 1, 2025
55
-- https://glennsqlperformance.com/
66
-- https://sqlserverperformance.wordpress.com/
77
-- YouTube: https://bit.ly/2PkoAM1
8-
-- Twitter: GlennAlanBerry
8+
-- Blue Sky: https://bsky.app/profile/glennalanberry.bsky.social
99

1010
-- Diagnostic Queries are available here
1111
-- https://glennsqlperformance.com/resources/
@@ -14,7 +14,7 @@
1414
-- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server
1515

1616
--******************************************************************************
17-
--* Copyright (C) 2024 Glenn Berry
17+
--* Copyright (C) 2025 Glenn Berry
1818
--* All rights reserved.
1919
--*
2020
--*

bin/diagnosticquery/SQLServerDiagnosticQueries_2008R2.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
-- SQL Server 2008 R2 Diagnostic Information Queries
33
-- Glenn Berry
4-
-- Last Modified: March 6, 2024
4+
-- Last Modified: January 1, 2025
55
-- https://glennsqlperformance.com/
66
-- https://sqlserverperformance.wordpress.com/
77
-- YouTube: https://bit.ly/2PkoAM1
8-
-- Twitter: GlennAlanBerry
8+
-- Blue Sky: https://bsky.app/profile/glennalanberry.bsky.social
99

1010
-- Diagnostic Queries are available here
1111
-- https://glennsqlperformance.com/resources/
@@ -14,7 +14,7 @@
1414
-- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server
1515

1616
--******************************************************************************
17-
--* Copyright (C) 2024 Glenn Berry
17+
--* Copyright (C) 2025 Glenn Berry
1818
--* All rights reserved.
1919
--*
2020
--*

bin/diagnosticquery/SQLServerDiagnosticQueries_2012.sql

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
-- SQL Server 2012 Diagnostic Information Queries
33
-- Glenn Berry
4-
-- Last Modified: November 1, 2024
4+
-- Last Modified: February 13, 2025
55
-- https://glennsqlperformance.com/
66
-- https://sqlserverperformance.wordpress.com/
77
-- YouTube: https://bit.ly/2PkoAM1
8-
-- Twitter: GlennAlanBerry
8+
-- Blue Sky: https://bsky.app/profile/glennalanberry.bsky.social
99

1010
-- Diagnostic Queries are available here
1111
-- https://glennsqlperformance.com/resources/
@@ -25,7 +25,7 @@
2525

2626

2727
--******************************************************************************
28-
--* Copyright (C) 2024 Glenn Berry
28+
--* Copyright (C) 2025 Glenn Berry
2929
--* All rights reserved.
3030
--*
3131
--*
@@ -56,6 +56,9 @@ IF NOT EXISTS (SELECT * WHERE CONVERT(varchar(128), SERVERPROPERTY('ProductVersi
5656
SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version Info];
5757
------
5858

59+
-- SQL Server 2012 is out of both mainstream and extended support from Microsoft
60+
61+
5962
-- SQL Server 2012 RTM Branch Builds SQL Server 2012 SP1 Branch Builds SQL Server 2012 SP2 Branch Builds SQL Server 2012 SP3 Branch Builds SQL Server 2012 SP4 Branch Builds
6063
-- Build Description Release Date Build Description Release Date Build Description Release Date Build Description Release Date Build Description Release Date
6164
-- 11.0.2100 RTM 3/6/2012
@@ -150,9 +153,6 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In
150153
-- Download SQL Server Management Studio (SSMS)
151154
-- https://bit.ly/1OcupT9
152155

153-
-- Download and install Azure Data Studio
154-
-- https://bit.ly/2vgke1A
155-
156156
-- SQL Server 2012 Configuration Manager is SQLServerManager11.msc
157157

158158
-- SQL Server troubleshooting (Microsoft documentation resources)

bin/diagnosticquery/SQLServerDiagnosticQueries_2014.sql

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
-- SQL Server 2014 Diagnostic Information Queries
33
-- Glenn Berry
4-
-- Last Modified: November 1, 2024
4+
-- Last Modified: February 13, 2025
55
-- https://glennsqlperformance.com/
66
-- https://sqlserverperformance.wordpress.com/
77
-- YouTube: https://bit.ly/2PkoAM1
8-
-- Twitter: GlennAlanBerry
8+
-- Blue Sky: https://bsky.app/profile/glennalanberry.bsky.social
99

1010
-- Diagnostic Queries are available here
1111
-- https://glennsqlperformance.com/resources/
@@ -25,7 +25,7 @@
2525

2626

2727
--******************************************************************************
28-
--* Copyright (C) 2024 Glenn Berry
28+
--* Copyright (C) 2025 Glenn Berry
2929
--* All rights reserved.
3030
--*
3131
--*
@@ -56,6 +56,9 @@ IF NOT EXISTS (SELECT * WHERE CONVERT(varchar(128), SERVERPROPERTY('ProductVersi
5656
SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version Info];
5757
------
5858

59+
-- SQL Server 2014 is out of both mainstream and extended support from Microsoft
60+
61+
5962
-- SQL Server 2014 RTM Branch Builds SQL Server 2014 SP1 Branch Builds SQL Server 2014 SP2 Branch Builds SQL Server 2014 SP23 Branch Builds
6063
-- Build Description Release Date Build Description Release Date Build Description Release Date Build Description Release Date
6164
-- 11.0.9120 CTP1 6/2/2013
@@ -143,9 +146,6 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In
143146
-- Download SQL Server Management Studio (SSMS)
144147
-- https://bit.ly/1OcupT9
145148

146-
-- Download and install Azure Data Studio
147-
-- https://bit.ly/2vgke1A
148-
149149
-- SQL Server 2014 Configuration Manager is SQLServerManager12.msc
150150

151151
-- SQL Server troubleshooting (Microsoft documentation resources)

bin/diagnosticquery/SQLServerDiagnosticQueries_2016.sql

+26-25
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
-- SQL Server 2016 Diagnostic Information Queries
33
-- Glenn Berry
4-
-- Last Modified: November 1, 2024
4+
-- Last Modified: March 1, 2025
55
-- https://glennsqlperformance.com/
66
-- https://sqlserverperformance.wordpress.com/
77
-- YouTube: https://bit.ly/2PkoAM1
8-
-- Twitter: GlennAlanBerry
8+
-- Blue Sky: https://bsky.app/profile/glennalanberry.bsky.social
99

1010
-- Diagnostic Queries are available here
1111
-- https://glennsqlperformance.com/resources/
@@ -25,7 +25,7 @@
2525

2626

2727
--******************************************************************************
28-
--* Copyright (C) 2024 Glenn Berry
28+
--* Copyright (C) 2025 Glenn Berry
2929
--* All rights reserved.
3030
--*
3131
--*
@@ -56,6 +56,9 @@ IF NOT EXISTS (SELECT * WHERE CONVERT(varchar(128), SERVERPROPERTY('ProductVersi
5656
SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version Info];
5757
------
5858

59+
-- SQL Server 2016 is out of mainstream from Microsoft
60+
61+
5962
-- SQL Server 2016 RTM Branch Builds -- SQL Server 2016 SP1 Branch Builds -- SQL Server 2016 SP2 Branch Builds
6063
-- Build Description Release Date Build Description Release Date Build Description Release Date
6164
-- 13.0.200.172 CTP 2.0 5/26/2015
@@ -123,9 +126,6 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In
123126
-- Download SQL Server Management Studio (SSMS)
124127
-- https://bit.ly/1OcupT9
125128

126-
-- Download and install Azure Data Studio
127-
-- https://bit.ly/2vgke1A
128-
129129
-- SQL Server 2016 Configuration Manager is SQLServerManager13.msc
130130

131131
-- SQL Server troubleshooting (Microsoft documentation resources)
@@ -1498,21 +1498,21 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE);
14981498
-- Queries 55 through 61 are the "Bad Man List" for stored procedures
14991499

15001500
-- Top Cached SPs By Execution Count (Query 55) (SP Execution Counts)
1501-
SELECT TOP(50) LEFT(t.[text], 50) AS [Short Query Text], qs.execution_count AS [Execution Count],
1502-
qs.total_logical_reads AS [Total Logical Reads],
1503-
qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads],
1504-
qs.total_worker_time AS [Total Worker Time],
1505-
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
1506-
qs.total_elapsed_time AS [Total Elapsed Time],
1501+
SELECT TOP(100) CONCAT(SCHEMA_NAME(p.schema_id), '.', p.name) AS [SP Name], qs.execution_count AS [Execution Count],
1502+
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
15071503
qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time],
1504+
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
1505+
qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads],
15081506
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
15091507
CONVERT(nvarchar(25), qs.last_execution_time, 20) AS [Last Execution Time],
1510-
CONVERT(nvarchar(25), qs.creation_time, 20) AS [Plan Cached Time]
1511-
--,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel
1512-
FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK)
1513-
CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t
1514-
CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp
1515-
WHERE t.dbid = DB_ID()
1508+
CONVERT(nvarchar(25), qs.cached_time, 20) AS [Plan Cached Time]
1509+
-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan
1510+
FROM sys.procedures AS p WITH (NOLOCK)
1511+
INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK)
1512+
ON p.[object_id] = qs.[object_id]
1513+
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
1514+
WHERE qs.database_id = DB_ID()
1515+
AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0
15161516
ORDER BY qs.execution_count DESC OPTION (RECOMPILE);
15171517
------
15181518

@@ -1522,7 +1522,7 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE);
15221522

15231523

15241524
-- Top Cached SPs By Avg Elapsed Time (Query 56) (SP Avg Elapsed Time)
1525-
SELECT TOP(25) p.name AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
1525+
SELECT TOP(25) CONCAT(SCHEMA_NAME(p.schema_id), '.', p.name) AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
15261526
qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_count,
15271527
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
15281528
qs.total_worker_time/qs.execution_count AS [AvgWorkerTime],
@@ -1546,7 +1546,7 @@ ORDER BY avg_elapsed_time DESC OPTION (RECOMPILE);
15461546

15471547

15481548
-- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 57) (SP Worker Time)
1549-
SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime],
1549+
SELECT TOP(25) CONCAT(SCHEMA_NAME(p.schema_id), '.', p.name) AS [SP Name], qs.total_worker_time AS [TotalWorkerTime],
15501550
qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count,
15511551
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
15521552
qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
@@ -1568,7 +1568,7 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE);
15681568

15691569

15701570
-- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 58) (SP Logical Reads)
1571-
SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads],
1571+
SELECT TOP(25) CONCAT(SCHEMA_NAME(p.schema_id), '.', p.name) AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads],
15721572
qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count,
15731573
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
15741574
qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
@@ -1590,7 +1590,7 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE);
15901590

15911591

15921592
-- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 59) (SP Physical Reads)
1593-
SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads],
1593+
SELECT TOP(25) CONCAT(SCHEMA_NAME(p.schema_id), '.', p.name) AS [SP Name], qs.total_physical_reads AS [TotalPhysicalReads],
15941594
qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count,
15951595
qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
15961596
CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index],
@@ -1613,7 +1613,7 @@ ORDER BY qs.total_physical_reads DESC, qs.total_logical_reads DESC OPTION (RECOM
16131613

16141614
-- Top Cached SPs By Total Logical Writes (Query 60) (SP Logical Writes)
16151615
-- Logical writes relate to both memory and disk I/O pressure
1616-
SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites],
1616+
SELECT TOP(25) CONCAT(SCHEMA_NAME(p.schema_id), '.', p.name) AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites],
16171617
qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count,
16181618
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
16191619
qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time],
@@ -1637,7 +1637,7 @@ ORDER BY qs.total_logical_writes DESC OPTION (RECOMPILE);
16371637

16381638

16391639
-- Cached SPs Missing Indexes by Execution Count (Query 61) (SP Missing Index)
1640-
SELECT TOP(25) p.name AS [SP Name], qs.execution_count AS [Execution Count],
1640+
SELECT TOP(25) CONCAT(SCHEMA_NAME(p.schema_id), '.', p.name) AS [SP Name], qs.execution_count AS [Execution Count],
16411641
ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute],
16421642
qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time],
16431643
qs.total_worker_time/qs.execution_count AS [Avg Worker Time],
@@ -1732,7 +1732,8 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE);
17321732
-- Find missing index warnings for cached plans in the current database (Query 65) (Missing Index Warnings)
17331733
-- Note: This query could take some time on a busy instance
17341734
SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName],
1735-
cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan
1735+
cp.objtype, cp.usecounts, cp.size_in_bytes
1736+
, qp.query_plan -- Uncomment if you want the Query Plan
17361737
FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK)
17371738
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp
17381739
WHERE CAST(qp.query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%'

0 commit comments

Comments
 (0)