Log shipping monitor (primary)


Job details

Name: Log shipping monitor (primary)
Platform: Sqlserver
Category: Cluster and Replication
Description: Monitor the primary database in each log shipping configuration, including information about the last backup file and last restored file.
Long description: Monitor the primary database in each log shipping configuration, including information about the last backup file and last restored file.
Version: 1.2
Default schedule: 5,15,25,35,45,55 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2005′ & hasengine=‘YES’ & engine_edition = ‘Microsoft SQL Server’ & eng_inst_priv = 0]

Parameters

Name Default value Description
ignore databases model List over the databases (separated by comma) which will be ignored from being checked.

Job Summary

SELECT primary_server, primary_database, last_backup_date, last_backup_file, backup_threshold FROM msdb..log_shipping_monitor_primary ORDER BY last_backup_date DESC;

Details of Implementation

This monitoring job for dbWatch Control Center is configured specifically for SQL Server instances (post 2005 version) that include the database engine. The job checks if there are any primary databases in a log shipping configuration that have failed to complete a log backup within a specified threshold time. By iterating through these databases, the job assesses if the last backup time exceeds the predefined threshold and flags these instances accordingly.

Here’s a breakdown of how it’s set up:

Implementation Logic in SQL Procedure:

Reporting Template

The report generated by this job provides a succinct overview of log shipping statuses across monitored SQL Server instances, detailing:

Server Database Last backup Backup info Warning threshold (minutes)
--- --- --- --- ---
Server Name Database Name Date & Time File Details Minutes

This allows database administrators to quickly assess the state of log shipping across their environment and address any potential issues promptly.