AG synchronization lag


Job details

Name: AG synchronization lag
Platform: Sqlserver
Category: Cluster and Replication
Description: Checks AG synchronization lag.
Long description: Checks AG synchronization lag.
Version: 1.43
Default schedule: 1,6,11,16,21,26,31,36,41,46,51,56 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[ maj_version > ‘2005′ & hasengine=‘YES’ & alwayson_active=‘YES’ & engine_edition = ‘Microsoft SQL Server’ & eng_inst_priv = 0]

Parameters

Name Default value Description
ignore databases List of alwayson databases (separated by comma) which will be ignored. You can use % (percent sign) to represent wild card characters.
warning threshold 60 The maximum number of seconds the last commit time on secondary replica can be behind the primary replica before a warning is triggered.
alarm threshold 360 The maximum number of seconds the last commit time on secondary replica can be behind the primary replica before an alarm is triggered.
history threshold 7 The number of days the statistics are kept in the history table.
max objects per graph 5 The maximum number of objects visualized in the report graphs.
ignore events 1 This parameter makes it possible to “skip” a warning or an alarm (one or more times) during initial synchronization lag detection.

Job Summary

SELECT p.replica_server_name AS [Primary replica], s.replica_server_name AS [Secondary replica], p.[db_name] AS [Database Name], p.[last_commit_time] AS [Last commit time], DATEDIFF(ss, s.last_commit_time, p.last_commit_time) AS [Sync Lag Secs] FROM dbw_synchronization_lag_current p JOIN dbw_synchronization_lag_current s ON s.[db_name] = p.[db_name] WHERE p.[role] = 'PRIMARY' AND s.[role] = 'SECONDARY' ORDER BY [Sync Lag Secs] DESC;

Implementation Details

Job Dependencies

Job Schedule

Monitoring Outputs

Key Parameters (No detailed descriptions)

Graphical Reporting

Recovery and Cleanup Mechanisms