Category: Performance Tuning

  • 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 Schema Change History

    ,

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

  • DBA Scripts: Get Active Connections by Database

    ,

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

  • DBA Scripts: Get Query Store Regressions and Forced Plans

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning “What Changed Today” and “Is the Plan I Forced Still Any Good” Query Store Top Queries tells you what’s expensive right now. This post covers two narrower, sharper questions that come up once Query Store…

  • DBA Scripts: Get Extended Events Sessions

    ,

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

  • 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…

  • 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 Four Angles on “Why Is This Slow” That Go Beyond Top CPU Top CPU Queries ranks by raw resource consumption. These four scripts answer more specific questions the ranking alone can’t: Get-StoredProcedurePerformance ranks stored procedures…

  • 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 three scripts give you the per-session detail underneath that number. Get-ActiveSessions…

  • DBA Scripts: Get Top CPU Queries

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting › Query & Performance Tuning Three Different Ways a Query Can Be the Problem “Which query is causing this” has more than one right answer, because a query can be expensive in different ways: it can burn CPU, it can…

  • DBA Scripts: Query and Performance Tuning

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Performance & Troubleshooting “The database is slow” almost never means the whole database, it means one query, one plan, one statistic that went stale at the wrong moment. Eight scripts on this site cover the full path from “something feels slow” to a…