Tag: Monitoring

  • DBA Scripts: Get Database Health

    Part of the DBA-Tools Project. 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. None of these are exotic checks, but they’re exactly the…

  • DBA Scripts: Get Recent Error Log Entries

    Part of the DBA-Tools Project. The SQL Server error log records almost everything worth knowing about an instance’s recent health, and almost nobody reads it until they’re already troubleshooting something. It’s not that the information isn’t there, it’s that xp_readerrorlog returns thousands of lines dominated by routine noise, every successful backup, every log backup, every…

  • DBA Scripts: Get Service Broker Health and Database Mail Queue

    Part of the DBA-Tools Project. Two Messaging Systems That Run Quietly Until They Don’t Service Broker and Database Mail are both messaging infrastructure, and both are easy to forget are even active, since SQL Server uses Service Broker internally for things like Availability Group health checks, and Database Mail just sits there until something needs…

  • DBA Scripts: Get Collation Conflicts and Cross-Database Dependencies

    Part of the DBA-Tools Project. Two Things That Break Silently at Migration or Decommission Time Two checks that rarely matter until the exact moment they do: does this database’s collation match the server’s (and every other database it might join against), and does anything in this database reach into another database or another server by…

  • DBA Scripts: Get Compression Candidates

    Part of the DBA-Tools Project. Where Compression Actually Pays Off Row and page compression trade CPU for storage and I/O, and that trade is worth making on some tables and not others. The biggest, least-frequently-updated tables are usually the best candidates: maximum space and I/O savings, minimal CPU cost relative to the table’s overall activity.…

  • DBA Scripts: Get Schema Change History

    Part of the DBA-Tools Project. “What Changed on This Server Recently?” That question comes up after almost every unexpected behavior change: a query that used to work now errors, a report that used to return data now doesn’t, a job that used to succeed now fails. Before chasing the symptom, it’s worth answering the more…

  • DBA Scripts: Get Active Connections by Database

    Part of the DBA-Tools Project. The Check Before You Take Anything Offline Taking a database offline, whether for a decommission, a restore, or a maintenance operation that needs exclusive access, starts with the same question: is anyone actually using it right now? Guessing wrong means an unexpected outage for whoever was still connected. This script…

  • DBA Scripts: Get CDC and Change Tracking

    Part of the DBA-Tools Project. Two Features, Same Risk: They Both Grow the Transaction Log Change Data Capture and Change Tracking answer a similar question, “what changed and when,” for two different audiences, ETL/replication consumers for CDC, application-level conflict detection for Change Tracking. They’re unrelated under the hood, but they share the exact same operational…

  • DBA Scripts: Get Extended Events Sessions

    Part of the DBA-Tools Project. What’s Actually Running on a Server You Just Inherited Extended Events sessions are easy to lose track of. Someone sets one up to chase a specific problem, the problem gets fixed, and the session keeps running quietly forever. On a server you’ve just inherited, you have no idea what’s active,…

  • DBA Scripts: Get Filegroup Space

    Part of the DBA-Tools Project. The Filegroup That’s Actually About to Run Out Database Free Space Summary tells you a database has plenty of room overall. That can still be wrong for a specific filegroup: a database on multiple filegroups can look comfortable in total while its PRIMARY filegroup, or a specific secondary filegroup an…