Author: Peter Whyte
-
DBA Scripts: Get Last Database Backup Times
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Backup & Recovery Checking the last backup times is one of the first things worth doing when you sit down at a SQL Server instance, whether it’s one you’ve owned for years or one you inherited an hour ago. Before making changes, running…
Written by
-
DBA Scripts: Get Disk Space on SQL Server
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity A SQL Server that runs out of disk stops taking writes, and depending on which volume filled up, that can mean suspended databases, a frozen transaction log, or failed backups at exactly the wrong moment. Disk space is the least…
Written by
-
Testing Remote Server Port Connectivity with PowerShell
Testing connectivity to remote server ports is a basic skill every DBA should have. Not just DBAs either, anyone running production systems needs to be able to answer one simple question quickly: Can this server actually reach that server on this port? This post shows two reliable ways to test whether a remote port is…
Written by
-
DBA Scripts: Get Long-Running Queries
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning When users report the application is slow, the first question is always the same: what is actually running right now? Not what ran an hour ago, not what the plan cache thinks is expensive on…
Written by
-
How to Check Listening Ports on Windows
When troubleshooting connectivity issues, it’s often not enough to test whether a remote port is reachable. You also need to know what is actually listening on a port locally, or whether anything is listening at all. This post focuses on the local side of the equation, what is listening on the machine itself and which…
Written by
-
DBA Scripts: Get Missing Indexes
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Index Maintenance Every time SQL Server builds an execution plan that could have been improved with a better index, it makes a note of it. Those notes accumulate in memory and are queryable through the sys.dm_db_missing_index_* DMVs, and combined…
Written by
-
Get Last Database Restore Date and Time in SQL Server
Knowing when a database was last restored is useful during incident response, audits, and general environment validation. This is not about backup schedules or restore progress.It is a simple historical check that answers one question: When was this database last restored? This post shows a reliable way to retrieve the most recent restore date and…
Written by
-
DBA Scripts: Get Index Fragmentation Across Databases
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Index Maintenance Index fragmentation checks are usually written for one database at a time, which is fine until you inherit an instance with forty databases and no idea which of them has been skipping maintenance. Running a per-database script…
Written by
-
DBA Scripts: Get User Permissions Audit
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security The One Login You Actually Care About Right Now Most permissions checks answer a broad question: who has sysadmin, what roles exist, what’s granted where. Useful for a periodic audit, but not what you reach for when someone asks “why does Sarah…
Written by
-
Deleting Rows in Batches in SQL Server
Deleting large volumes of data from a SQL Server table looks simple, but it can cause real problems if done carelessly. A single large DELETE can: When you’re cleaning up historical data or running routine maintenance, deleting rows in batches is usually the safest and most predictable approach. This post shows a simple, production-safe pattern…
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 (38)
- Maintenance (24)
- Migration & Upgrades (14)
- Monitoring (6)
- Performance Tuning (35)
- Security (Encryption & Permissions) (20)
- Storage & Capacity (14)
- T-SQL Fundamentals (11)
- Troubleshooting (54)
- Wait Types (235)
Latest Posts
- 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)
- Logical Consistency-Based I/O Error in SQL Server (Errors 823 and 824)
- Cannot Recover the Master Database (Error 3417) and What the Log Actually Says
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)