Database backup (system databases)


Job details

Name: Database backup (system databases)
Platform: Sqlserver
Category: Availability
Description: This procedure analyzes the FULL backup statistics for the system databases (master, model and msdb) using data from the msdb.dbo.backupset table.
Long description: This procedure analyzes the FULL backup statistics for the system databases (master, model and msdb) using data from the msdb.dbo.backupset table.
Version: 1.4
Default schedule: 25 6 * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2000′ & hasengine=‘YES’ & alwayson_active=‘NO’ & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
time threshold 168 An alert is triggered (parameter value “return status”) if the number of hours (default 168 hours – 1 week) since the last FULL backed up is greater than this parameter value.
include databases master, msdb List of system databases to be checked for backup (separated by comma).
return status 1 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when missing or old backup for system databases.

Job Summary

SELECT database_name, MAX(backup_finish_date) AS last_backup_date FROM msdb.dbo.backupset WHERE database_name IN ('master', 'model', 'msdb') AND type = 'D' GROUP BY database_name;

Detailed Operation

Monitoring Logic

Output and Reporting

Database name Last backup Backup Age (hours)
master 2020-01-01 12:00:00 30
model 2020-01-01 12:00:00 30
msdb 2020-01-02 12:00:00 24

Upgrade Considerations

Implementation and Maintenance

This detailed analysis ensures that the dbWatch job effectively contributes to operational resilience by facilitating proactive management of system database backups.