DatabaseMaintenance - System Parameter
DatabaseMaintenance turns the nightly Log Database maintenance of the Logging Service on or off: reindexing fragmented indexes and shrinking archive Log Databases. Turn it off only when your own SQL Server maintenance takes care of the Nodinite Log Databases.
At a Glance
| Property | Value |
|---|---|
| Key | DatabaseMaintenance |
| Data type | boolean |
| Default | true |
| Read by | Logging Service |
| Takes effect | Within about 15 seconds; no restart needed. Applies from the next maintenance window. |
| Status | ✅ Active |
| Since | Nodinite 3 |
How It Works
When the value is true, the Logging Service runs maintenance between 03:00 and 04:00; the exact start depends on what else the service is doing.
| Log Database | Maintenance |
|---|---|
| Online Log Database | Reindex when reported fragmentation is above 10%. |
| Archive Log Databases | Reindex when reported fragmentation is above 10%. Shrink to return unused disk space to the operating system. |
- Shrink is a privileged operation: the Logging Service account needs the
sysadminrole. Take regular backups before you rely on it. - This parameter does not control retention. The removal of old data per Message Type runs separately; see Data Retention on the Logging Service page and CleanUpTimerInterval.
When the value is false, the Logging Service skips this maintenance, and your DBA must reindex and shrink the Log Databases.
Choosing a Value
- Keep
true(recommended), and exclude the Nodinite databases from your own maintenance jobs. Two maintenance processes on the same databases overlap and compete. - Set
falseonly when your own jobs are meant to maintain the Nodinite Log Databases. - Set
falsewhen the Logging Service account is notsysadmin; otherwise the shrink fails every night. See SQL Server Sysadmin Requirements.
Example: Exclude Nodinite Databases in IndexOptimize
If you use Ola Hallengren's IndexOptimize and every Nodinite database name starts with Nodinite (the default LogDatabaseName pattern), exclude them with a wildcard:
EXECUTE dbo.IndexOptimize
@Databases = 'USER_DATABASES,-Nodinite%',
@FragmentationLow = NULL,
@FragmentationMedium = 'INDEX_REORGANIZE,INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
@FragmentationHigh = 'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE',
@UpdateStatistics = 'ALL';
This excludes, for example, Nodinite_DEMO_Config and Nodinite_DEV_Log_20241108. Adjust the pattern if you changed LogDatabaseName.