Status: Reviewed (deep-dive v1)
Stack: PowerShell (volume/mount free space) → SQL file-size history/procs → Blazor Server UI
Depends on: SQL-01 Inventory (instances); complements SQL-02 (backup targets need disk too)
Goal: See data/log growth early, keep volumes from surprising you, and forecast before “disk full” pages you at 2am.
Backups and jobs fail hard when disks fill. Capacity is the bridge between “healthy today” and “still healthy next quarter.”
| Signal | Yellow | Red |
|---|---|---|
| Volume free space | < 20% | < 10% (or < fixed GB floor for small disks) |
| Log file / data ratio unusual | Log > 50% of data without reason | Log runaway / repeated growth |
| Days-to-full (linear forecast) | < 30 days | < 14 days |
| Autogrowth storms | Many growth events / day | Growth during peak + user impact |
Tune floors for tiny system volumes vs large data LUNs.
T-SQL (per instance):
sys.databases + sys.master_files: size, max_size, growth, is_percent_growth, type (rows/log), physical_namefn_trace_gettable or XE if already deployed (don’t invent heavy tracing in v1)CollectedAtPowerShell (per host):
Get-Volume / Win32_Volume)physical_name roots → volume (best-effort)Read-only. Don’t shrink in collectors.
| Table | Purpose |
|---|---|
dbo.SqlDataFile |
Latest file inventory per DB |
dbo.SqlDataFileHistory |
Size samples over time |
dbo.HostVolume |
Volume free/total per host |
dbo.HostVolumeHistory |
Volume samples |
dbo.CapacityForecast |
Optional cached days-to-full |
Procs:
usp_Capacity_ApplyFileSnapshot — upsert files + historyusp_Capacity_ApplyVolumeSnapshot — upsert volumes + historyusp_Capacity_GetTightVolumes — Blazor volume cardusp_Capacity_GetTopGrowing — fastest growers (MB/day)usp_Capacity_GetDatabaseDetail — file layout + sparkline dataForecast (simple v1): linear regression or (latest − size_30d_ago) / 30 → days until volume free < Red floor. Label as estimate.
SHRINKFILE as a lifestyle — use for one-time reclaim after cleanup, then set sane growth | Symptom | Likely cause |
|---|---|
| Log full | Missing log backup; long tran; replication/AG lag |
| Data autogrowth during peak | Poor initial size; percent growth; unexpected load |
| Volume Red but DBs small | Non-SQL consumers; leftover backups on data disk |
| Forecast flaps | Sparse history; restore inflated size; one-time load |
| Mount point missed | PS only checked drive letters |
Performance health · Patching & build currency · HA/DR awareness · Alerting & runbooks
SQL Dude — SQL-06 Capacity & Growth v1