/microsoft-sql-admin:resource-usage-sqlserver [CPUHighThreshold] [MemoryHighThreshold]from Microsoft SQL administration
Generates a resource usage report for SQL Server, Azure SQL Managed Instance, Azure SQL Database, and Fabric SQL Database. Use when many queries time out under load or overall slowness with unclear CPU, memory, IO, TempDB, or disk cause.
Ships in Microsoft SQL administration. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill when the user asks about:
Targets all SQL platforms:
Unsupported Platforms: Azure Synapse Analytics (Engine Edition 6, 11) and Azure SQL Edge (Engine Edition 9) are not supported. Queries will return an early-exit message on these platforms.
slow-query-investigation skill; for a configuration, security, or backup audit, use the health-audit-sqlserver skill.For Azure SQL Database (EngineEdition 5), read Azure-specific guidance before choosing diagnostic queries. It preserves the service-specific permissions, capture limitations and error interpretation. Keep this skill's scope and authorization rules; the reference is not a second workflow to run unconditionally.
Detect the actual platform before selecting DMVs. Azure database resource percentages and instance percentages have different denominators; do not treat them as interchangeable. High memory utilization alone is not proof of memory pressure. Correlate the same time window with waits, worker/session limits and resource-governance evidence; distinguish a governed IO ceiling from storage latency. An empty or permission-denied result is not zero utilization. Local container behavior is not proof of managed-service limits.
After identifying the bottleneck, use investigate-sql-cpu-pressure, investigate-sql-data-io-pressure, investigate-sql-log-io-pressure or investigate-sql-memory-issues for focused diagnosis. A read-only diagnosis does not authorize scaling or configuration changes.
microsoft-sql-admin plugin
(mssql_list_database_connections, mssql_connect_database, then mssql_execute_query); any
other SQL tool the agent host provides for running T-SQL and reading result sets;
sqlcmd from a terminal. If the
SQL Tools MCP server is not connected or lists no connections, follow the sql-tools-mcp-setup
skill, which asks before installing or configuring anything. If no SQL tool can be made available,
give the user the T-SQL to run and ask for the results.VIEW SERVER PERFORMANCE STATE (VIEW SERVER STATE before SQL Server 2022) or, on Azure
SQL Database, VIEW DATABASE PERFORMANCE STATE or ##MS_ServerStateReader##, plus any other read
permission these queries need. A tool is only as read-only as the login it connects with.| Parameter | Default | Description |
|---|---|---|
| TopNClerks | 10 | Number of memory clerks to display in memory allocation breakdown |
| CPUHighThreshold | 70 | CPU percentage above which to classify as "HIGH" |
| MemoryHighThreshold | 90 | Memory percentage above which to classify as "HIGH" |
| DiskFreeWarningPct | 15 | Free space percentage below which to flag as warning |
| TempDBWaitThresholdMs | 50 | Minimum wait duration (ms) to include in TempDB contention analysis |
| TempDBHighSeverityMs | 1000 | Wait duration (ms) above which TempDB contention is classified as HIGH |
| RunnableTasksWarning | 5 | Runnable tasks count threshold for "THREAD PRESSURE" warning |
| MemoryLowThresholdPct | 10 | Available memory percentage below which to flag OS memory pressure (SQL Server/MI only) |
| MaxSchedulers | 32 | Maximum scheduler rows to return in per-scheduler load analysis |
| IncludeTempDBAnalysis | true | Whether to run TempDB contention check |
| IncludeThreadpoolHealth | true | Whether to run threadpool health analysis |
| IncludeDiskSpace | true | Whether to run disk volume free space check (SQL Server/MI only) |
| MaxResults | 20 | Maximum rows to return per diagnostic section |
Gather all of the following data before generating the report:
references/queries-sqlserver.md or references/queries-azuresql.mdengine_edition result, follow the appropriate path below:| Engine Edition | Platform | Query File |
|---|---|---|
| 1–4 | SQL Server (on-prem / IaaS) | references/queries-sqlserver.md |
| 8 | Azure SQL Managed Instance | references/queries-sqlserver.md |
| 5 | Azure SQL Database | references/queries-azuresql.md |
| 12 | Fabric SQL Database | references/queries-azuresql.md |
| 6, 9, 11 | Unsupported | Stop — report unsupported platform |
Load and execute queries from references/queries-sqlserver.md:
SOFTNUMA column)IncludeDiskSpace = true)EXEC sp_spaceusedIncludeTempDBAnalysis = true)IncludeThreadpoolHealth = true)Load and execute queries from references/queries-azuresql.md:
sys.dm_db_resource_stats, ~1 hour)EXEC sp_spaceusedIncludeTempDBAnalysis = true)
⚠️ TempDB latch waits may not be visible on Azure SQL DB / Fabric (DMV is database-scoped)
IncludeThreadpoolHealth = true)Generate the report using the appropriate layout below based on the detected platform. Replace {{ }} sections with analysis from the collected data. Do not show the instructions to the user.
## Resource Usage Report
Server Name: {{current server name}}
Date: {{current date in YYYY-MM-DD format}}
---
### CPU Usage
#### Current CPU and NUMA Configuration:
MAXDOP: {{MAXDOP setting}}
Nodes: {{number of NUMA nodes}}
OnlineSchedulers: {{number of online schedulers}}
TotalCores: {{total number of cores}}
CPU_per_Node: {{number of CPUs per NUMA node}}
SOFTNUMA: {{SOFTNUMA status}}
#### CPU Utilization:
> Data sourced from `RING_BUFFER_SCHEDULER_MONITOR`, which retains approximately the last 4 hours (~1 sample/minute).
{{1 to 2 sentence summary of the historical CPU utilization highlighting any periods with relatively high CPU usage. Note whether SQL Server or external processes are consuming CPU.}}
#### Per-Scheduler Load Summary:
{{1 to 2 sentence summary of the load balancing across SQLOS schedulers and whether or not there are any concerns.}}
---
### Memory Usage
#### Memory Pressure Checks
##### Physical Memory:
Total Server Physical Memory: {{total server physical memory value}}
Available Server Physical Memory: {{available server physical memory value}}
Memory State: {{physical memory state value}}
##### Process Memory:
Physical Memory Used: {{physical memory used value}}
Memory Utilization Percentage: {{memory utilization percentage value}}
##### Analysis
{{one sentence summary of your analysis of the notifications and if there are any concerns}}
#### Memory Allocation per Clerk (Top {{TopNClerks}})
{{list of memory allocation per clerk}}
##### Analysis:
{{one sentence summarizing your analysis of the allocation across memory clerks and if there are any concerns}}
---
### Disk Volume Free Space
{{table of disk volumes with Drive, Drive Name, Total Size (GB), Available Size (GB), Free Space %}}
##### Analysis:
{{one sentence summarizing disk space status. Flag any volumes with less than 15% free space as a concern.}}
---
### Disk Space Usage
#### Database: {{current database name}}
Database Size: {{current database size value}}
Unallocated Space: {{unallocated space value}}
Reserved: {{reserved space value}}
Data: {{data space value}}
Index Size: {{index size value}}
Unused: {{unused space value}}
##### Analysis:
{{one sentence summarizing your analysis of the disk space usage and if there are any concerns}}
---
### TempDB Contention
#### Active TempDB Latch Waits:
{{table showing session_id, wait_type, wait_duration_ms, PageType (PFS/GAM/SGAM), ContentionSeverity}}
##### Analysis:
{{one sentence summary of TempDB contention. If HIGH TEMPDB CONTENTION detected, note the page type causing issues.}}
##### Recommendations:
- If PFS page contention: Consider enabling trace flag 1118 (pre-SQL 2016) or mixed extents are disabled by default (SQL 2016+)
- If multiple sessions waiting: Consider adding more TempDB data files (1 per CPU core, up to 8)
- If GAM/SGAM contention: Heavy object creation in TempDB; review temp table usage patterns
---
### Threadpool Health
#### Current Thread Status:
Platform: {{platform}}
Total Runnable Tasks: {{TotalRunnableTasks}}
Total Queued Tasks: {{TotalQueuedTasks}}
Threadpool Waits: {{ThreadPoolWaits}}
Thread Health: {{ThreadHealth classification}}
##### Analysis:
{{one sentence based on ThreadHealth status and LikelyCause from query}}
##### Recommendations:
- If CRITICAL (Thread Pool Starvation): Check for blocking chains, reduce parallel query concurrency, review MAXDOP settings
- If HIGH RISK (Worker Queue Buildup): Identify long-running queries, check for resource contention
- If WARNING (Thread Pressure): Monitor trend; may indicate approaching capacity limits
---
### Summary of Findings
{{1 to 2 sentence summary of the overall resource usage analysis and if there are any concerns.}}
If you would like details on any of the analysis sections, please let me know.
## Resource Usage Report
Database Name: {{current database name}}
Date: {{current date in YYYY-MM-DD format}}
---
### CPU Usage
#### CPU Utilization:
> Data sourced from `sys.dm_db_resource_stats`, which retains the last ~1 hour (15-second intervals).
{{1 to 2 sentence summary of the historical CPU utilization highlighting any periods with relatively high CPU usage. For Azure SQL DB, note whether it is a DB-specific or instance-wide issue.}}
#### Per-Scheduler Load Summary:
{{1 to 2 sentence summary if scheduler data was collected, or "N/A — scheduler details managed by platform."}}
---
### Workload Metrics (Past Hour)
{{Summarize CPU %, Data IO %, Log Write %, Worker %, Session % trends. Flag any metric consistently above 80%.}}
---
### Memory Usage
#### Memory Pressure:
{{Summarize avg_memory_usage_percent trends. For Azure SQL DB, also note avg_instance_memory_percent if available.}}
#### Memory Allocation per Clerk (Top {{TopNClerks}})
{{list of memory allocation per clerk}}
##### Analysis:
{{one sentence summarizing your analysis of the allocation across memory clerks and if there are any concerns}}
---
### Plan Cache Bloat
##### Amount of plan cache used by queries executed once:
{{amount of plan cache bloat — total MBs used by single-use plans}}
---
### Disk Space Usage
#### Database: {{current database name}}
Database Size: {{current database size value}}
Unallocated Space: {{unallocated space value}}
Reserved: {{reserved space value}}
Data: {{data space value}}
Index Size: {{index size value}}
Unused: {{unused space value}}
##### Analysis:
{{one sentence summarizing your analysis of the disk space usage and if there are any concerns}}
---
### TempDB Contention
{{If data available: table showing session_id, wait_type, wait_duration_ms, PageType, ContentionSeverity}}
{{If no data: "TempDB latch waits are not visible on this platform (DMV is database-scoped)."}}
---
### Threadpool Health
#### Current Thread Status:
Platform: {{platform}}
Total Runnable Tasks: {{TotalRunnableTasks}}
Total Queued Tasks: {{TotalQueuedTasks}}
Threadpool Waits: {{ThreadPoolWaits}}
Thread Health: {{ThreadHealth classification}}
##### Analysis:
{{one sentence based on ThreadHealth status and LikelyCause from query}}
---
### Summary of Findings
{{1 to 2 sentence summary of the overall resource usage analysis and if there are any concerns.}}
If you would like details on any of the analysis sections, please let me know.
sys.dm_os_volume_stats is not available).CPUHighThreshold, MemoryHighThreshold, etc.) before execution.investigate-sql-cpu-pressure and wait-category-analysis skillsinvestigate-sql-memory-issues skillcheck-live-blocking and blocking-root-cause-analysis skillsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub microsoft/microsoft-sql --plugin microsoft-sql-admin47 skills in this plugin
/active-connectionsUse when the user asks who is connected, which sessions are idle or hold the oldest open transaction, or how connections split by login or app. If a client can't connect, use `connectivity-troubleshoot`./always-encrypted-columnsUse when the user asks which plaintext columns can or should use Always Encrypted, or why a column is disqualified. Eligibility only: not for listing already-encrypted columns or their keys./authentication-diagnosticsUse when a login fails (18456, 'Login failed for user'), a user can't open a database, a permission is denied, or an Entra or managed identity login fails. For network errors, use `connectivity-troubleshoot`.Other plugins' skills for the same job