Maintenance Overview
DB24 automates the routine maintenance work that keeps SQL Server databases fast, reliable, and healthy. Rather than relying on default SQL Server behaviours or manually scheduled scripts, DB24 monitors your databases continuously and applies the right maintenance action at the right time — with configurable thresholds, safety guards, and full logging of every operation.
Why Maintenance Matters
Left unattended, SQL Server databases accumulate problems that compound over time:
- Undetected corruption can go unnoticed until it causes data loss or application failure
- Fragmented indexes cause the query engine to read more pages than necessary, slowing down queries that were once fast
- Stale statistics lead the optimizer to generate inefficient execution plans, often with no obvious cause
- Undersized database files trigger auto-grow events that stall queries while SQL Server expands files on the fly
Automated maintenance addresses all of these proactively, on a schedule, within configured maintenance windows.
Maintenance Categories
Index Maintenance
Monitors fragmentation across all eligible indexes and selects the appropriate action based on fragmentation level and index type. Rowstore indexes are reorganized or rebuilt depending on how fragmented they are. Columnstore indexes are always reorganized using a method that flushes all delta rowgroups into the columnstore. Small indexes below configurable page and row count thresholds are excluded to avoid wasting maintenance time where there is no practical benefit.
Integrity Maintenance
Runs DBCC CHECKDB against each eligible database to detect physical corruption, logical inconsistencies, and allocation errors. DB24 captures the full output, distinguishes between confirmed corruption and execution failures, and raises alerts immediately when problems are found. Supports AG-aware scheduling so checks run on whichever replica handles backups.
Statistics Maintenance
Updates statistics objects that have drifted beyond configured age and modification thresholds. Keeps the query optimizer working from accurate data distribution information, reducing the risk of sudden plan regressions. Statistics explicitly flagged with NORECOMPUTE are respected and never touched.
File Size Maintenance
Proactively grows database files before they exhaust their allocated space. Instead of relying on SQL Server's reactive auto-grow, DB24 monitors free space within each file and pre-allocates space when headroom drops below a threshold. Multiple safety checks prevent growth operations from consuming too much of the host volume's remaining free space.
Common Behaviour
All four maintenance types share a consistent set of runtime behaviours:
Maintenance windows are enforced.
Every category checks cfg.fnIsMaintenanceTime() at each iteration. If the window closes mid-run, processing stops immediately — no operation is started outside the window.
Disk space is checked before acting.
Before any operation that could consume disk space, DB24 verifies that the host volume has sufficient headroom. If it does not, the current database or file is skipped and a warning is logged.
Everything is logged.
Every operation — successful or not — is written to the maintenance log with the exact command executed, start and end times, and any error details. Warnings are raised for skipped databases, disk threshold breaches, and unexpected failures.
Exclusions are respected.
Any database or object listed in cfg.Exclusions is skipped cleanly, with no logging noise.
Related Documentation
- DB24 Overview — Platform introduction
- Notifications — Alert configuration
