Category: Performance Tuning
-
DBA Scripts: Get Blocking Summary
When Everything Looks Busy But Nothing Is Moving Blocking is one of the most common causes of a SQL Server that suddenly looks frozen. Applications start timing out, users report that everything has stopped responding, and the server itself looks fine: CPU is low, disk queues are calm, nothing is crashing. Dozens of sessions are…
Written by
-
DBA Scripts: Get Temp DB Hotspots
Temp DB is shared by every database and every session on the instance: temp tables, table variables, sort and hash spills, version store for snapshot isolation, all of it lands in the same handful of files. When Temp DB is under pressure, contention or growth events, the first question is always “who’s actually using it…
Written by
-
DBA Scripts: Get Query Store Top Queries
Query Store is SQL Server’s built-in flight recorder for query performance: every query’s plan, runtime stats, and history, retained and queryable without any extra tracing setup. Most instances have had it available since SQL Server 2016, and a surprising number still have it switched off, which means every “what changed” investigation starts from nothing. This…
Written by
-
DBA Scripts: Get Query Store Status
Query Store is the single most useful diagnostic feature SQL Server has shipped in the last decade, a built-in, per-database history of every query’s plans and runtime stats, no third-party tooling required. And it fails in one of the quietest ways possible: it either isn’t turned on at all, or it’s silently full and has…
Written by
-
DBA Scripts: Get Implicit Conversions
An indexed lookup is scanning when it should seek, or CPU is climbing with no single query to blame, and the application sends its strings as nvarchar. This script lists every cached statement whose plan carries SQL Server’s implicit conversion warning, the ones that lost an index seek first. Why Implicit Conversions Matter When the…
Written by
-
DBA Scripts: Get Statistics Health
Query plans are only as good as the statistics SQL Server uses to build them. When a table’s data distribution changes but its statistics don’t get refreshed to match, the optimizer keeps making decisions based on a picture of the data that’s no longer true, choosing a scan when a seek would be faster, or…
Written by
-
DBA Scripts: Get Deadlock Summary
The application logged Msg 1205 and you need to know which 2 statements collided, on what, and which one lost. SQL Server already recorded the deadlock graph in the built-in system_health Extended Events session, and this script reads it back. Msg 1205 on the victim’s connectionthe symptom, not something to copy Msg 1205, Level 13,…
Written by
-
DBA Scripts: Get Blocking Chains
A single blocked session is usually easy to spot. The harder case is a chain: session C is waiting on session B, B is waiting on session A, and A is sitting idle holding a lock from a transaction nobody remembers is still open. Killing C does nothing. A is the problem, at the top…
Written by
-
DBA Scripts: Get Recent Error Log Entries
The SQL Server error log records almost everything worth knowing about an instance’s recent health, and almost nobody reads it until they’re already troubleshooting something. It’s not that the information isn’t there, it’s that xp_readerrorlog returns thousands of lines dominated by routine noise, every successful backup, every log backup, every clean CHECKDB, until the two…
Written by
-
DBA Scripts: Remove XE Session
An Extended Events session you stood up for a decommission audit, a login trace, or a stored procedure profile isn’t meant to run forever. Once you’ve got the evidence, it’s just overhead, disk space, buffer memory, and one more thing a future DBA has to figure out the purpose of. The trouble is finding every…
Written by
- Tune a Slow Query With Copilot in SSMS
- xp_readerrorlog: Read the SQL Server Error Log with T-SQL
- Cannot Drop Database Because It Is Currently in Use (Error 3702)
- Could Not Drop Login Because the User Is Currently Logged In (Error 15434)
- Set a Maximum Database File Size in SQL Server (MAXSIZE)
- SQL Server Activity Monitor in SSMS (and the Performance Dashboard)
- Backups & Recovery (18)
- DBA Scripts (154)
- High Availability (HA) (13)
- Installation & Configuration (60)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (10)
- Performance Tuning (38)
- Security (Encryption & Permissions) (25)
- Storage & Capacity (18)
- T-SQL Fundamentals (17)
- Troubleshooting (108)
- Wait Types (236)