Author: Peter Whyte
-
DBA Scripts: Get Blocking Chains
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Blocking & Locking A single blocked session is usually easy to spot. The harder case is a chain: session C is waiting on session B, which is itself waiting on session A, which is sitting idle holding a lock…
Written by
-
DBA Scripts: Get Orphaned Users
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security An orphaned user is a database user whose SID no longer matches any server login, usually left behind after a database restore or attach on a different server, a migration, or a login that was dropped without cleaning up the database users…
Written by
-
DBA Scripts: Get Database Backup History
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Backup & Recovery Most backup checks answer one question: what’s the latest backup. That’s the right question most of the time, but it hides everything that happened before it. A backup job that ran reliably for a year and then quietly changed behaviour…
Written by
-
When Shrinking Temp DB Just Won’t Shrink
This is broken. You run DBCC SHRINKFILE on the Temp DB data files, maybe throw in a CHECKPOINT for good measure, and nothing moves. The files sit there stubbornly taking up space you need back. I am not in the habit of shrinking databases. It fragments files and usually just creates more work later. But…
Written by
-
DBA Scripts: Get Recent Error Log Entries
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting 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…
Written by
-
DBA Scripts: Get Backup Restore Progress
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Backup & Recovery A large restore has been running for twenty minutes. Is it about to finish, or is it barely a quarter done? SSMS won’t tell you unless you started it interactively and left that session open, and a restore kicked off…
Written by
-
DBA Scripts: Get Backup Encryption Status
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Backup & Recovery TDE (Transparent Data Encryption) and backup encryption are two different things that get confused constantly. TDE encrypts the data and log files at rest. It does not automatically encrypt your backups in a way msdb tracks as an encrypted backup…
Written by
-
DBA Scripts: Get Backup Chain Integrity
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Backup & Recovery You can have a full backup from last night and still not be able to restore to 2pm today. That’s the gap this script closes. Backup coverage checks tell you when your last backups ran. They don’t tell you whether…
Written by
-
DBA Scripts: Get Backup Restore Duration Estimate
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Backup & Recovery Planning a maintenance window is a guessing game if you don’t know how long your own backups actually take. “It usually takes about an hour” is a guess. A throughput figure calculated from your own backup history, applied to the…
Written by
-
DBA Scripts: Remove XE Session
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Extended Events & Tracing 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…
Written by
Start Here
- DBA Scripts: The Complete Guide
- Run a Full Health Check
- DBA Scripts & Tools
- SSMS: The Complete Guide
- SQL Server Errors: The Complete Guide
- Wait Types Library
The Pillars
Blog Categories
- Backups & Recovery (16)
- DBA Scripts (151)
- High Availability (HA) (12)
- Installation & Configuration (44)
- Maintenance (24)
- Migration & Upgrades (14)
- Monitoring (7)
- Performance Tuning (35)
- Security (Encryption & Permissions) (20)
- Storage & Capacity (14)
- T-SQL Fundamentals (11)
- Troubleshooting (55)
- Wait Types (235)
Latest Posts
- Cannot Execute As the Database Principal (Error 15517)
- Silent Failures: The SQL Server Problems That Never Raise an Error
- SQL Server Login Migration: What Gets Silently Left Behind
- CREATE USER WITHOUT LOGIN vs Contained Database Users
- The sqldba MCP Server: Give Your AI Assistant a Verified SQL Server Reference
- Cannot Resolve the Collation Conflict (Error 468)
Blog Tags
Access (4) Always On Availability Groups (4) Auditing (7) Backups (6) Blocking (4) Blocking Locking (6) Collectors (7) Database Backups & Recovery (8) Database Backups and Recovery (5) Database Maintenance (7) DBA Tools (24) Disk Space (5) Error Log (3) Extended Events (8) Features (6) High Availability (6) Indexes (7) Installation (7) Inventory (8) Maintenance (6) Migration (14) Monitoring (27) Performance (21) Performance Troubleshooting (9) PowerShell (4) Query Behaviour (5) Security (10) SQL Agent (5) SQL Scripts (17) SQL Server Administration (10) SQL Server Configuration (7) SQL Server Errors (5) SQL Server High Availability (4) SQL Server Internals (3) SQL Server Management Studio (SSMS) (6) SQL Server Monitoring (7) SQL Server Networking (9) SQL Server Security (7) Storage and Capacity (7) T-SQL (10) Temp DB (3) Tracing (7) Transaction Logs (4) Troubleshooting (24) Windows Server (4)