SQL DBA Blog: Home

  • DBA Scripts: Get Backup Restore Progress

    Part of the DBA-Tools Project. A large restore has been running for twenty minutes. Is it about to finish, or is it barely a quarter done? SSMS won’t tell you unless you started it interactively and left that session open, and a restore kicked off from a script, a job, or someone else’s session gives…

    read more

  • DBA Scripts: Get Backup Encryption Status

    Part of the DBA-Tools Project. TDE (Transparent Data Encryption) and backup encryption are two different things that get confused constantly. TDE encrypts the data and log files at rest. It does not automatically encrypt your backups in a way msdb tracks as an encrypted backup set, and it definitely doesn’t help you if a .bak…

    read more

  • DBA Scripts: Get Backup Chain Integrity

    Part of the DBA-Tools Project. You can have a full backup from last night and still not be able to restore to 2pm today. That’s the gap this script closes. Backup coverage checks tell you when your last backups ran. They don’t tell you whether the log backups between them actually form an unbroken chain.…

    read more

  • DBA Scripts: Get Backup Restore Duration Estimate

    Part of the DBA-Tools Project. Planning a maintenance window is a guessing game if you don’t know how long your own backups actually take. “It usually takes about an hour” is a guess. A throughput figure calculated from your own backup history, applied to the size of what you’re about to back up or restore,…

    read more

  • DBA Scripts: Remove XE Session

    Part of the DBA-Tools Project. An Extended Events session you stood up for a decommission audit, a login trace, or a stored procedure profile isn’t meant to run forever. Once you’ve got the evidence, it’s just overhead, disk space, buffer memory, and one more thing a future DBA has to figure out the purpose of.…

    read more

  • DBA Scripts: Get XE Session Activity

    Part of the DBA-Tools Project. Standing up a trace session is the easy part. The actual decision, is this database safe to decommission, is that service account still connecting from the right host, comes from reading the results back and turning raw events into an answer. Extended Events writes to rolling .xel files, and reading…

    read more

  • DBA Scripts: Get Active XE Sessions

    Part of the DBA-Tools Project. Extended Events sessions have a way of quietly accumulating on a busy instance. Someone stood up a trace for a specific investigation six months ago, and it’s still running, still writing files, and nobody remembers why. Before you start a new session, or clean up an old one, you need…

    read more

  • DBA Scripts: Create SP Execution Session

    Part of the DBA-Tools Project. Query Store and the plan cache tell you what’s expensive. Neither tells you what’s actually called, by what, how often. Before a migration, you need to know which stored procedures matter in practice, not which ones look interesting in a cached plan that might not even be current anymore. Before…

    read more

  • DBA Scripts: Create Decommission Audit Session

    Part of the DBA-Tools Project. “I think nothing uses this database anymore” is not evidence. It is a guess, and it is the kind of guess that turns into an incident report when the thing you dropped turns out to be feeding a monthly finance job nobody remembered. Proving a database is genuinely unused takes…

    read more

  • DBA Scripts: Create Login Activity Session

    Part of the DBA-Tools Project. “Who actually connects to this server?” is a question you can’t answer from documentation. Not who’s supposed to connect, who is. Ownership changes, connection strings get copied into three other applications nobody told you about, and a service account keeps authenticating from a box that was decommissioned eighteen months ago.…

    read more