Category: DBA Scripts

  • DBA Scripts: Get Error Log Patterns

    Part of the DBA-Tools Project. Group the Error Log Instead of Scrolling It The SQL Server error log is where the instance tells you what’s wrong, but on a busy server it’s also where hundreds of routine startup, backup, and checkpoint messages bury the handful of lines that actually matter. Scrolling xp_readerrorlog output looking for…

  • DBA Scripts: Get Edition Feature Usage

    Part of the DBA-Tools Project. What Actually Breaks If You Downgrade This Instance Edition downgrades, Enterprise to Standard, Standard to Web, look simple until you discover a feature that only Enterprise supports has quietly been in use the whole time. TDE-encrypted databases won’t open on Standard at all. Resource Governor configuration silently stops working. A…

  • DBA Scripts: Maintenance and Automation

    Part of the DBA-Tools Project. Is the Automation Healthy, and Is It Actually Doing the Job A SQL Agent job that silently stopped running is one of the quietest failure modes in SQL Server, nothing errors, nothing alerts, the work it used to do just stops happening until someone notices the symptom weeks later. This…

  • DBA Scripts: Performance and Troubleshooting

    Part of the DBA-Tools Project. Four Ways of Answering “Why Is It Slow” “The database is slow” is rarely one problem. Sometimes it’s a query, a bad plan, a stale statistic. Sometimes it’s blocking, and the fix is completely different depending on which one it actually is. Sometimes the DMV snapshot has already missed the…

  • DBA Scripts: Server and Configuration

    Part of the DBA-Tools Project. What This Server Is, and How It Got That Way Two pillars, one underlying question: before performance, before security, before anything else, what is this SQL Server instance, and how did it come to be configured the way it is. Server Inventory answers the first half, a snapshot of what’s…

  • DBA Scripts: Collectors and Baseline Infrastructure

    Part of the DBA-Tools Project, in the Performance and Troubleshooting area. From “Check When Asked” to “Already Watching” Every other pillar on this site answers a question the moment you ask it: what’s blocking right now, what are the current wait stats, how much free space is on disk today. The Collectors pillar is different.…

  • DBA Scripts: Generate Collector Alerts

    Part of the DBA-Tools Project. The Job That Reads Every Other Collector and Actually Tells You Something’s Wrong Every collector in this pillar writes evidence somewhere, blocking chains, deadlocks, wait stats, VLF counts, database growth, TempDB pressure. None of them, on their own, tells anyone anything. Generate-CollectorAlertJob.sql is the cross-cutting piece: one recurring job that…

  • DBA Scripts: Get Patch Level

    Part of the DBA-Tools Project. 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 manage and you get a patch compliance inventory, ready to compare against what’s…

  • DBA Scripts: Collect Health and Configuration Baselines

    Part of the DBA-Tools Project. Four Collectors, One Real Table-Design Bug Found Testing Them 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. Testing the AG health collector against a real instance surfaced a genuine table-design…

  • DBA Scripts: Get Transaction Log Size and Usage

    Part of theDBA-Tools Project. 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 writes, and production quickly turns into an incident. Many environments monitor…