Database Log backup


Job details

Name: Database Log backup
Platform: Sqlserver
Category: Availability
Description: This procedure checks the database transaction log backups from the msdb.dbo.backupset table (excluding system databases: master, model and msdb).
Long description: This procedure checks the database transaction log backups from the msdb.dbo.backupset table (excluding system databases: master, model and msdb).
Version: 2.3
Default schedule: 20 0,2,4,6,8,10,12,14,16,18,20,22 * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2012′ & hasengine=‘YES’ & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
ignore databases model The list of databases to be ignored (separated by comma).
warning threshold 4 A warning is triggered if the number of hours since the last transaction log has been backed up is greater than this parameter.
return status when missing backup 2 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when missing transaction log backup of a database.
return status when old backup 2 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when the last backup date of the transaction log is older than the “backup date threshold” parameter value.
exclude databases if new 24 If the database has been created within the last 24 hours (default value), no warning/alarm will be triggered.
exclude databases in Always On availability groups YES If set to YES the alert will exclude all databases in Always On availability groups.
exclude log shipping databases YES If set to YES the alert will exclude all databases in a log shipping configuration (databases in msdb.dbo.log_shipping_secondary_databases table).
exclude standby databases YES If set to YES the alert will exclude all databases in state online as read-only, with restore log allowed (IsInStandBy property set to TRUE).

Job Summary

SELECT database_name, MAX(backup_finish_date) AS last_backup FROM msdb.dbo.backupset WHERE type = 'L' GROUP BY database_name;

Job Details

Core Functionality

Implementation Specifics

Scheduled Checks

Dependencies and Adjustments

Changes and Upgrades

Conclusion

This dbWatch monitoring job plays an essential role in operational resilience by ensuring all critical transaction log data is backed up. It provides necessary alerts that prompt maintenance actions, helping to avert potential crises by maintaining up-to-date and accessible database backups.