← ClaudeAtlas

sqlserver-perf-triagelisted

Diagnose performance problems on ANY Microsoft SQL Server instance or database. The bundled script collects a read-only DMV snapshot (top queries by CPU/reads, wait statistics, live blocking, deadlock graphs, missing/unused indexes, fragmentation, stale statistics, server/database configuration) as JSON; the agent interprets it and proposes next actions. Use when the user reports a slow SQL Server, a slow database/application, blocking or deadlocks, or wants a SQL Server health check — e.g. "why is SQLSRV01 slow", "check the SQL server behind our app", "are there blocking sessions right now". Do NOT use for Dynamics NAV 2009 or AX 2012 databases — use nav2009-sql-performance / ax2012-sql-performance, which add the application-specific interpretation. Requires PowerShell 7+ and VIEW SERVER STATE.
whobat/AI-Agent-skills · ★ 0 · API & Backend · score 76
Install: claude install-skill whobat/AI-Agent-skills
# SQL Server Performance Triage > Works against **any SQL Server instance** (2005 → current). The bundled script > `scripts/Invoke-SqlPerfTriage.ps1` collects a **read-only** diagnostic snapshot and emits > JSON; **the agent (you) writes the analysis.** The script never modifies server or database > state. `SCRIPT` = this skill's `scripts/Invoke-SqlPerfTriage.ps1`. Interpretation guide in [REFERENCE.md](REFERENCE.md). This script is vendored identically in the NAV 2009 and AX 2012 sibling skills — if the target database belongs to one of those applications, prefer the sibling skill for its application-specific interpretation. ## Permissions & auth - Default is **Windows integrated auth**. Pass `-SqlCredential (Get-Credential)` for SQL auth — never put a password on the command line. - Needs **VIEW SERVER STATE** on the instance and **VIEW DATABASE STATE** (or `db_owner`) in the target database. The trace-flag sub-check may need sysadmin and degrades gracefully. - Connections are unencrypted by default; add `-Encrypt` if the instance has a valid certificate. ## How to run Always run with `pwsh`. Parse the JSON it prints on stdout. | Want | Pass | |------|------| | **Full snapshot of a DB** | `-ServerInstance SQLSRV01 -Database 'AppDB'` | | **Named instance** | `-ServerInstance 'SQLSRV01\INST01'` | | **Server-level only (no DB)** | omit `-Database` (DB-scoped sections report `skipped`) | | **Only some sections** | `-Sections waits,blocking,deadlocks` | | **SQL auth**