Category: DBA Scripts

  • DBA Scripts: Create Decommission Audit Session

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Extended Events & Tracing “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…

  • DBA Scripts: Create Login Activity Session

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Extended Events & Tracing “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,…

  • DBA Scripts: Get Heaps

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Maintenance & Automation › Index Maintenance Heaps in SQL Server Explained A surprising amount of SQL Server performance pain comes from tables that were never given a clustered index. These heaps often start life as quick prototypes, staging tables, or legacy leftovers —…

  • DBA Scripts: Get SQL Server Database File Details

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Understanding SQL Server Database File Layout SQL Server database files are one of those areas where small configuration issues can become large operational problems. A database may be running perfectly today, but poor file placement, incorrect growth settings, or uncontrolled…

  • DBA Scripts: Get Sysadmin Members

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security Identify SQL Server Logins With Sysadmin Access The sysadmin fixed server role provides unrestricted access to a SQL Server instance. Members of this role can perform any operation on the server, including creating databases, changing security settings, accessing all data, and modifying…

  • DBA Scripts: Get Database Sizes and Free Space

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity Get SQL Server Database Sizes and Free Space Database size checks are one of the first things I review when assessing a SQL Server environment. The goal is simple: understand where storage is being consumed, identify databases that need attention,…

  • DBA Scripts: Get VLF Counts

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Storage & Capacity VLFs – The Hidden Log Performance Problem Virtual Log File (VLF) count is one of those SQL Server health checks that is often overlooked. It rarely generates alerts, doesn’t usually slow down a single query, and most users never know…

  • DBA Scripts: Generate Test Databases

    Related Pillar Post: Backups and Recovery When you’re validating migrations, failover, or automation at scale, you need realistic volume: hundreds or thousands of databases to stress-test backups, restores, log shipping, and copy operations. This helper automates that setup, it creates batches of small, randomized databases with configurable sizes and naming, so you can reproduce large-scale…

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

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration 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…

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

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration 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…