Author: Peter Whyte
-
DBA Scripts: Get Database Health
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Before diving into anything deeper, a health check should start with the basics: is every database actually online, is the recovery model what it’s supposed to be, and is anything quietly stuck waiting for a log backup it isn’t getting.…
Written by
-
DBA Scripts: Get Duplicate Indexes
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Index Maintenance Indexes accumulate the same way clutter does: one developer adds an index to fix a slow query, a colleague adds a near-identical one three months later because the first one wasn’t obvious from the name, and nobody…
Written by
-
DBA Scripts: Get Statistics Health
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning 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…
Written by
-
DBA Scripts: Get Migration Risk Assessment
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Migration & Deployment Every migration has a list of things that will cause a problem if nobody checks for them first: a database in an Availability Group that needs coordinated removal, a linked server dependency that won’t resolve on the target, an owner…
Written by
-
DBA Scripts: Get Unused Indexes
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Index Maintenance Every non-clustered index has to be maintained by SQL Server on every INSERT, UPDATE, and DELETE against the table. A table with 12 non-clustered indexes means 12 index updates for every row changed. Some of those indexes…
Written by
-
DBA Scripts: Get Deadlock Summary
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Blocking & Locking 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…
Written by
-
DBA Scripts: Get Replication Status
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: High Availability A subscriber is showing stale data, or you need to know what this server replicates and to where before you change anything: run this on the Distributor and it lists every transactional and snapshot subscription with its status decoded, in one…
Written by
-
DBA Scripts: Extended Events Tracing
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting Ask most DBAs “what’s actually connecting to this server” or “is this database still in use” and you’ll get an opinion, not an answer. SQL Server doesn’t track any of this for you by default, no login history worth trusting,…
Written by
-
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 The Login Exists, the Database Still Says No An account that worked last week stops working against one database. The password is right, the login is there in Object Explorer, the user is still in the database with its roles intact, and…
Written by
- DBA Scripts: Get Log Shipping Status
- SQL Server Row-Level Security: The Filter Does Not Stop Cross-Tenant Writes
- View the Definition of a Stored Procedure in SQL Server
- TempDB Is Full or Still Growing: Find What Is Using It, Right Now
- SQL Server Service Will Not Start: Error 17113, 17058, 1067 and Where the Real Reason Is
- How to Move TempDB Files in SQL Server
- Backups & Recovery (17)
- DBA Scripts (152)
- High Availability (HA) (13)
- Installation & Configuration (49)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (9)
- Performance Tuning (37)
- Security (Encryption & Permissions) (20)
- Storage & Capacity (16)
- T-SQL Fundamentals (15)
- Troubleshooting (94)
- Wait Types (235)