ax2012-sql-performancelisted
Install: claude install-skill whobat/AI-Agent-skills
# AX 2012 SQL Performance Triage
> Targets **SQL Server instances hosting Dynamics AX 2012 / R3 databases** — the main AX
> transaction DB, and the Retail **channel database** behind POS. The bundled script
> `scripts/Invoke-SqlPerfTriage.ps1` collects a **read-only** diagnostic snapshot and emits
> JSON; **the agent (you) writes the analysis** using the AX interpretation guide in
> [REFERENCE.md](REFERENCE.md) — read it before writing your analysis.
`SCRIPT` = this skill's `scripts/Invoke-SqlPerfTriage.ps1` (vendored identically in
`sqlserver-perf-triage` and `nav2009-sql-performance`).
## Permissions & auth
- Default is **Windows integrated auth**; `-SqlCredential (Get-Credential)` for SQL auth.
- Needs **VIEW SERVER STATE** + **VIEW DATABASE STATE** (or `db_owner`) in the AX/channel DB.
- Add `-Encrypt` if the instance has a valid certificate.
## How to run
Always run with `pwsh`. Parse the JSON it prints on stdout.
```powershell
# Full triage of the AX transaction database
pwsh -File SCRIPT -ServerInstance SQLSRV01 -Database 'MicrosoftDynamicsAX' -OutFile C:\ops\ax-triage.json
# The Retail channel database
pwsh -File SCRIPT -ServerInstance SQLSRV02 -Database 'RetailChannelDB' -OutFile C:\ops\channel-triage.json
# "AX is frozen right now" — live locking picture only
pwsh -File SCRIPT -ServerInstance SQLSRV01 -Database 'MicrosoftDynamicsAX' -Sections blocking,deadlocks,waits
```
Sections: `server`, `database`, `waits`, `top_queries`, `missing_indexes`, `unused_ind