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:
Version: 2.0
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 > ‘2000′ & maj_version < ‘2014′ & 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.

Job Summary

SELECT database_name, MAX(backup_finish_date) AS last_db_backup_date
FROM msdb.dbo.backupset
WHERE type = 'L' -- 'L' for Log backups
GROUP BY database_name
HAVING (MAX(backup_finish_date) < DATEADD(hh, -[Your Defined Threshold], GETDATE()))

Job Configuration and Detail