Category: DBA Scripts
-
DBA Scripts: Get Patch Level
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration › Server Inventory Building a Patch Compliance Inventory Across an Estate Version and Edition answers “what is this one instance running” as a quick single-server snapshot. This script answers a related but different question: run it across every server you…
Written by
-
DBA Scripts: Collect Health and Configuration Baselines
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Collectors & Baselines Four Collectors, Four Different Rhythms AG health every few minutes if you’re running Availability Groups, index fragmentation weekly, Query Store’s top queries every 30 minutes, error log entries every 10. Each script below is a generator:…
Written by
-
DBA Scripts: Get Transaction Log Size and Usage
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Understanding Transaction Log Size Usage Keeping an eye on transaction log usage is one of the simplest ways to prevent unexpected database outages. When a transaction log fills, SQL Server cannot continue writing transactions, backups begin failing, applications stop processing…
Written by
-
DBA Scripts: Collect Capacity and Temp DB Baselines
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Collectors & Baselines Three Collectors for Capacity and TempDB DatabaseGrowth and VlfCount are system-versioned temporal tables, always current, no manual history-cleanup needed. The TempDB collector snapshots both file-level space and the top 10 session consumers in one pass. Each…
Written by
-
DBA Scripts: Collect Performance Baselines (Wait Stats, Perfmon, Storage I/O)
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Collectors & Baselines Three Cumulative Counters, Three Matching Delta Scripts sys.dm_os_wait_stats, sys.dm_os_performance_counters, and sys.dm_io_virtual_file_stats are all cumulative since the instance last started, a raw snapshot of any of them tells you almost nothing on its own. Three collector generators…
Written by
-
DBA Scripts: Collect Blocking and Deadlock Events
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Collectors & Baselines Standing Watch for Blocking and Deadlocks, Not Just Checking When Asked Get Blocking Sessions and Get Deadlock Summary answer “what’s happening right now.” These two generators answer a different question: “what happened while nobody was looking.”…
Written by
-
DBA Scripts: SQL Server Installation and Patching
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration Ten scripts covering a SQL Server instance’s whole install-to-patch lifecycle: confirm a machine is ready, install unattended, apply sensible defaults, validate the result, keep it patched, and remove it cleanly when it’s done, for both the SQL Server engine and…
Written by
-
DBA Scripts: Patch SQL Server and Check Status
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration › Installation & Patching Keep SQL Server Patched: Three Tools, One Job Patching is the job that never finishes: a new Cumulative Update lands, every instance needs it, and “are we current?” needs an answer on demand. This post is…
Written by
-
DBA Scripts: Uninstall SSMS via PowerShell
🛠️Part of the SSMS Complete Guide, installing, configuring and fixing SQL Server Management Studio.In: Server & Configuration › Installation & Patching When the Uninstaller Fails SSMS has to come off a machine, and Settings → Apps failed, left it half removed, or is no use across a fleet. This script finds every SSMS install in…
Written by
-
DBA Scripts: Install and Update SSMS via PowerShell
🛠️Part of the SSMS Complete Guide, installing, configuring and fixing SQL Server Management Studio.In: Server & Configuration › Installation & Patching The Scripted Version of Installing SSMS SSMS is behind or missing on a box and you want it current without clicking through the installer: this script installs or updates it silently, works out what…
Written by
- RESOURCE_SEMAPHORE When SQL Server Is Nowhere Near Its Memory Cap
- Dynamic Data Masking: What a WHERE Clause Still Reveals
- 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
- 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) (21)
- Storage & Capacity (16)
- T-SQL Fundamentals (15)
- Troubleshooting (95)
- Wait Types (235)