SQL DBA Blog: Home

  • DBA Scripts: Get Login and Job Inventory

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security Two Plain Inventories Every Migration Plan Needs Permissions and Role Membership and SQL Agent and Jobs cover the deep dive. These two are the plain inventory underneath both: Get-LoginInventory: the logins a migration has to recreate, by type and status. No permission…

    Read More


  • DBA Scripts: Get Index Usage Stats

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Index Maintenance The Raw Usage Data Behind Every Index Decision Unused Indexes already filters straight to drop candidates in one database. This script is the raw data underneath that filter, and more: every index across every user database, its…

    Read More


  • DBA Scripts: Get Database Snapshot Inventory

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity The Snapshot Everyone Forgot They Created A database snapshot is created for one specific reason, a pre-deployment rollback point, a reporting-consistency workaround, a test before a risky change, and then it just sits there. Snapshots don’t show up in a…

    Read More


  • DBA Scripts: The Complete Guide

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks. Where to Start With This Series The DBA Scripts series on this blog covers backups, blocking, indexes, SQL Agent, query performance, extended events tracing, server inventory, and security, organized into eight areas of the job, each one tying together a cluster of scripts…

    Read More


  • DBA Scripts: Get TempDB Usage and File Balance

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity How Full TempDB Is Right Now, and Whether Its Files Are Set Up Correctly TempDB Configuration and TempDB Hotspots already cover configuration baseline and allocation-contention diagnosis. These 2 scripts fill the gap between them: Get-TempdbUsage shows exactly how full each…

    Read More


  • DBA Scripts: Get Query Performance Deep-Dive

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning When Top CPU Doesn’t Explain “Why Is This Slow” The query usually runs fine and sometimes takes forever, or the server is slow and Top CPU Queries names nothing that explains it. A CPU ranking…

    Read More


  • DBA Scripts: Get Active Sessions and Requests

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting Who’s Connected, and What’s Actually Running Right Now Worker Threads and Active Sessions gives you the aggregate health number: how close the worker thread pool is to exhaustion. These 3 scripts give you the per-session detail underneath that number. Get-ActiveSessions…

    Read More


  • DBA Scripts: Get Suspect Pages and Integrity Checks

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Backup & Recovery Pages Already Recorded as Bad, and a Backup Check Before DBCC CHECKDB An 823 or 824 just landed in the error log, or DBCC CHECKDB is due and you want to know whether anything is already recorded against this server.…

    Read More


  • DBA Scripts: Security

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks. Who Can Do What, What’s Happening, and What’s Missing Security on an inherited SQL Server instance breaks down into four genuinely different questions, and a single “run a security scan” checklist tends to blur them together. Who has privileged access, right now? What’s…

    Read More


  • DBA Scripts: Get Audit Specifications, DDL Triggers, and Proxy Credentials

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security Three Kinds of Infrastructure Most Servers Never Had in the First Place A schema change or a new login fails on an inherited server and nothing in your own code explains it, an auditor asks what this instance records, or a SQL…

    Read More