Database Backup Status

Microsoft.SQLServer.2014.Database.DBBackupStatusMonitor (UnitMonitor)

This monitor checks the status of the database backup as reported by Microsoft SQL Server. Note: This monitor is disabled by default. Please use overrides to enable it when necessary.

Knowledge Base article:

Summary

This monitor checks the existence and age of database backup as reported by Microsoft SQL Server. This is done by running a query against the master database of the SQL instance and returning the age of the database backup.

Causes

Database has not been backed up for too long.

Resolutions

You should perform a database backup to resolve the issue.

To eliminate this issue in future it is recommended to schedule an automated backup according to the needs of the application and business requirements.

External

Best Practice recommendations for SQL Server Database Backups

Overrideable Parameters

Name

Description

Default Value

Enabled

 

No

Generates Alerts

 

Yes

Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.

86400

Synchronization Time

The synchronization time specified by using a 24-hour format. May be omitted.

 

Backup Period (days)

The target backup frequency in days. Should be set according to your Recovery Point Objective (RPO).

7

Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.

300

Element properties:

TargetMicrosoft.SQLServer.2014.Database
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2014.DBBackupStatus
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL 2014: Database backup should be performed
Database '{2}' in SQL Server instance '{1}' on computer '{0}' has not been backed up for {3} days.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2014.Database.DBBackupStatusMonitor" Accessibility="Public" Enabled="false" Target="SQL2014Core!Microsoft.SQLServer.2014.Database" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2014.DBBackupStatus" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2014.Database.DBBackupStatusMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.ServerRole"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.Database"]/DatabaseName$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.Database"]/DatabaseName$']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Good" MonitorTypeStateID="Good" HealthState="Success"/>
<OperationalState ID="Bad" MonitorTypeStateID="Bad" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ConnectionString>$Target/Host/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.DBEngine"]/ConnectionString$</ConnectionString>
<DatabaseName>$Target/Property[Type="SQL2014Core!Microsoft.SQLServer.2014.Database"]/DatabaseName$</DatabaseName>
<Threshold>7</Threshold>
<IntervalSeconds>86400</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>