Skip to content

Clive Roberts

SQL DBA

Menu
  • Setup
  • Performance
  • Health Check
  • Troubleshooting
  • T-SQL

Month: October 2026

Health Check 00: is this SQL Server running well?

October 15, 2026
| No Comments
| Health Check

One script that checks the whole server and returns a single list, worst first: CRITICAL (fix now), WARNING (look soon), OK and INFO. It covers backups, CHECKDB, disk space, failed jobs, waits, memory, tempdb, settings and more. Health Check 01 to 12 show the detail behind each line. Needs SQL Server 2016 SP2 or later….

Read More »

Posted in Health Check

Health Check 01: server overview

October 15, 2026
| No Comments
| Health Check

Version, patch level, edition, uptime, CPUs, memory and the key server settings in one place. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 01_Server_Overview.sql – version, uptime,…

Read More »

Posted in Health Check

Health Check 02: databases

October 15, 2026
| No Comments
| Health Check

Every database with its state, size, recovery model, what is holding up log reuse, and settings worth knowing (auto close, auto shrink, page verify, Query Store, RCSI, encryption). Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes…

Read More »

Posted in Health Check

Health Check 03: backups

October 15, 2026
| No Comments
| Health Check

The last full, differential and log backup of every database, hours since the last full, and the last 7 days of backup history. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server…

Read More »

Posted in Health Check

Health Check 04: disks and files

October 15, 2026
| No Comments
| Health Check

Free space on every drive that holds a database file, and each file’s size, space used and growth setting. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. –…

Read More »

Posted in Health Check

Health Check 05: SQL Agent jobs

October 15, 2026
| No Comments
| Health Check

SQL Agent jobs that failed in the last 7 days, what is running now, and the last outcome of every job. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server 2017 and…

Read More »

Posted in Health Check

Health Check 06: wait statistics

October 15, 2026
| No Comments
| Health Check

What SQL Server has spent its time waiting for since it started, with the harmless background waits left out, so the real bottleneck (CPU, disk, locks, memory, network) stands out. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area….

Read More »

Posted in Health Check

Health Check 07: activity and blocking

October 15, 2026
| No Comments
| Health Check

What is running right now and who is blocking whom. If sp_WhoIsActive is installed it uses that for more detail. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server 2017 and 2025….

Read More »

Posted in Health Check

Health Check 08: error log

October 15, 2026
| No Comments
| Health Check

Errors and warnings from the SQL Server error log in the last 7 days (current and previous log): failed logins, I/O warnings, deadlocks, memory paged out and so on. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only,…

Read More »

Posted in Health Check

Health Check 09: integrity checks

October 15, 2026
| No Comments
| Health Check

When each database last passed DBCC CHECKDB, and any suspect (possibly corrupt) pages recorded in msdb. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 09_Integrity.sql – when…

Read More »

Posted in Health Check

Health Check 10: memory and CPU

October 15, 2026
| No Comments
| Health Check

CPU use for the last few hours (SQL Server and everything else), memory use, and which memory clerks are using it. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server 2017 and…

Read More »

Posted in Health Check

Health Check 11: tempdb

October 15, 2026
| No Comments
| Health Check

tempdb files and how full they are, the version store, and which sessions are using tempdb right now. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 11_TempDB.sql…

Read More »

Posted in Health Check

Health Check 12: high availability

October 15, 2026
| No Comments
| Health Check

Health of availability groups, database mirroring and log shipping, whichever this server uses. Part of my SQL Server health check: run Health Check 00 for a one-page summary, then the numbered scripts for the detail behind each area. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 12_High_Availability.sql – availability groups, mirroring and…

Read More »

Posted in Health Check

Performance 01: top queries

October 15, 2026
| No Comments
| Performance

The queries using the most CPU, reads and time since their plans were cached. Change the ORDER BY to sort by reads or duration. For history across restarts use Query Store (Performance 02). Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 01_Top_Queries.sql – the queries using the most CPU, reads and time…

Read More »

Posted in Performance

Performance 02: Query Store regressions

October 15, 2026
| No Comments
| Performance

Run it in the database: queries that got slower in the last 24 hours than in the 7 days before, usually because the plan changed. Needs Query Store turned on. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 02_Query_Store_Regressions.sql – run IN the database: queries that got slower in the last 24…

Read More »

Posted in Performance

Performance 03: missing indexes

October 15, 2026
| No Comments
| Performance

Indexes SQL Server thinks would help, across all databases, since start-up, with a CREATE INDEX statement for each. Treat them as hints: check for overlap with existing indexes before creating any. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 03_Missing_Indexes.sql – indexes SQL Server thinks would help, across all databases, since start-up….

Read More »

Posted in Performance

Performance 04: unused indexes

October 15, 2026
| No Comments
| Performance

Run it in the database: indexes that are written to but never read since start-up. Only meaningful once the server has been up through a full business cycle (month end and so on). Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 04_Unused_Indexes.sql – run IN the database: indexes that are written to…

Read More »

Posted in Performance

Performance 05: statistics age

October 15, 2026
| No Comments
| Performance

Run it in the database: statistics that are more than 7 days old or have had more than 20% of rows changed since they were last updated. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 05_Statistics_Age.sql – run IN the database: statistics that are old or have had many changes since they…

Read More »

Posted in Performance

Performance 06: index fragmentation

October 15, 2026
| No Comments
| Performance

Run it in the database: fragmentation of every index over 1000 pages, using the light LIMITED scan. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. — 06_Index_Fragmentation.sql – run IN the database: fragmentation of indexes over 1000 pages (LIMITED scan, fairly light). Read-only. SET NOCOUNT ON; SELECT OBJECT_SCHEMA_NAME(ps.object_id) + N’.’ + OBJECT_NAME(ps.object_id) AS…

Read More »

Posted in Performance

Performance 07: cardinality estimate skew

October 15, 2026
| No Comments
| Performance

Finds where the optimiser’s row estimates are badly wrong, the root of most bad plans. Part 1 works on every version; part 2 (SQL Server 2019 and later) goes operator by operator through the last actual plan and shows the table, index and columns where a filtered statistic would help. Read-only, changes nothing. Tested on…

Read More »

Posted in Performance

Performance 08: filtered statistics candidates

October 15, 2026
| No Comments
| Performance

Run it in the database: columns whose data is lopsided enough that the normal statistics histogram misleads the optimiser, with the CREATE STATISTICS … WHERE statement that would fix it. It only suggests; it creates nothing. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. /* 08_Filtered_Statistics_Candidates.sql – run IN the database: columns whose…

Read More »

Posted in Performance

Performance 09: duplicate and overlapping indexes

October 15, 2026
| No Comments
| Performance

Run it in the database: indexes that duplicate or are covered by another index, and what they cost in writes. It suggests DROP statements but runs none. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. /* 09_Duplicate_and_Overlapping_Indexes.sql – run IN the database: indexes that duplicate or are covered by another index, and what…

Read More »

Posted in Performance

Performance 10: statistics health

October 15, 2026
| No Comments
| Performance

Run it in the database: the auto-statistics settings, how fresh and how well sampled every statistic is, and filtered statistics that have fallen behind. A fuller version of Performance 05. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. /* 10_Statistics_Health.sql – run IN the database: how fresh and how good every statistic is,…

Read More »

Posted in Performance

Performance 11: cardinality estimator audit

October 15, 2026
| No Comments
| Performance

Which cardinality estimator each database actually uses and why: compatibility level, LEGACY_CARDINALITY_ESTIMATION, trace flags and query hints, with advice on what to change. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. /* 11_CE_Configuration_Audit.sql – which cardinality estimator (CE) each database uses, and why. Clive Roberts DBA, 10 October 2026. Read-only. Server-wide. SQL Server…

Read More »

Posted in Performance

Performance 12: implicit conversions

October 15, 2026
| No Comments
| Performance

Queries in the plan cache where SQL Server has to convert a column’s data type (usually varchar against nvarchar), which can turn a seek into a scan and ruin row estimates. Read-only, changes nothing. Tested on SQL Server 2017 and 2025. /* 12_Implicit_Conversions.sql – queries in the plan cache where SQL Server has to convert…

Read More »

Posted in Performance

Categories

Sidebar

  • October 2026 (25)
  • November 2017 (1)
  • March 2017 (1)
  • October 2016 (13)
  • July 2016 (1)
  • May 2016 (1)
  • April 2016 (2)
  • March 2016 (1)
  • February 2016 (1)
  • November 2015 (1)
  • October 2015 (1)
  • September 2015 (1)
  • August 2015 (1)
  • July 2015 (7)
  • June 2015 (1)
  • May 2015 (6)
  • April 2015 (2)
  • March 2015 (2)
  • February 2015 (1)
  • January 2015 (1)
  • December 2014 (1)
  • October 2014 (1)
  • September 2014 (1)
  • August 2014 (1)
  • July 2014 (1)
  • June 2014 (1)
  • April 2014 (1)
  • March 2014 (1)
  • February 2014 (1)
  • January 2014 (1)
  • December 2013 (1)
  • November 2013 (1)
  • March 2013 (1)
  • January 2013 (1)
  • May 2012 (1)
  • April 2012 (1)
  • October 2011 (1)
  • September 2011 (1)
  • March 2010 (1)
  • Setup
  • Performance
  • Health Check
  • Troubleshooting
  • T-SQL

Precious Lite 2025 | All Rights Reserved. Precious Lite theme by Flythemes