Percent of Expired Subscriptions

Microsoft.SQLServer.2012.Replication.Monitor.PercentOfExpiredSubscriptions (UnitMonitor)

Percent of Expired Subscriptions Monitor

Knowledge Base article:

Summary

Measures the percent of expired subscriptions.

Causes

A subscription expires if it has not synchronized within the specified retention period.

For transactional replication, if a subscription is not synchronized within the publication retention period, the subscription will expire and be dropped by the expired subscription clean up job that runs on the Publisher.

For merge replication, the @retention and @retention_period_unit parameters of sp_addmergepublication are used to define the retention period. A subscription expires only if the subscription has not synchronized successfully in the retention period, and if there have been data changes to the subscriber’s partition.

Resolutions

For transactional replication, the subscription must be recreated and synchronized. If a push subscription expires, it is completely removed, however, pull subscriptions are not. Pull subscriptions must be cleaned up on the Subscriber.

When a merge subscription expires, the metadata for the subscription is removed. The subscription can be reinitialized up to double the retention period since the last successful synchronization. Once it passes a value of double the retention period, it is completely removed and must be recreated and synchronized. The subscription is removed automatically for push subscriptions by the Expired subscription clean up job. Pull subscriptions are not cleaned up and must be cleaned up on the subscriber.

The retention period may have to be adjusted to allow for increased duration between subscriber synchronizations. Be aware that by increasing this value, it will cause the amount of replication data to grow and has the potential to negatively impact replication performance.

External

Further information for subscription expiration management can be found at the following location:

http://technet.microsoft.com/library/ms151188.aspx

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow

Yes

Error Threshold

Error Threshold

10

Generates Alerts

Defines whether the workflow generates an Alert

Yes

Interval (seconds)

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

300

Timeout (seconds)

Timeout (seconds)

300

Synchronization Time

Synchronization Time

 

Warning Threshold

Warning Threshold

0

Element properties:

TargetMicrosoft.SQLServer.2012.Replication.Distributor
Parent MonitorSystem.Health.ConfigurationState
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2012.Replication.MonitorType.DistributorPercentOfDeactivatedSubscriptions
RemotableTrue
AccessibilityPublic
Alert Message
MSSQL2012 Replication: A high percentage of expired subscriptions has been detected on the Distributor.
The Distributor (Name: '{0}', Server: '{1}') has detected a high percentage of expired subscriptions.
Percent of expired subscriptions: {2}\%
Subscriptions:
{3}
RunAsMicrosoft.SQLServer.Replication.Monitoring.RunAs.Monitor

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.Replication.Monitor.PercentOfExpiredSubscriptions" Accessibility="Public" Enabled="true" Target="MS2RD!Microsoft.SQLServer.2012.Replication.Distributor" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.Replication.MonitorType.DistributorPercentOfDeactivatedSubscriptions" ConfirmDelivery="false" RunAs="MSRL!Microsoft.SQLServer.Replication.Monitoring.RunAs.Monitor">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2012.Replication.Monitor.DistributorPercentOfExpiredSubscriptions.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Library.GenericDistributor']/InstanceName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Library.GenericDistributor']/ConnectionString$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='DistributorPercentOfDeactivatedSubscriptions']$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='Message']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Health" MonitorTypeStateID="Health" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<SqlTimeout>300</SqlTimeout>
<ConnectionString>$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Library.GenericDistributor']/ConnectionString$</ConnectionString>
<MeasuredStateId>0</MeasuredStateId>
<WarningThreshold>0</WarningThreshold>
<ErrorThreshold>10</ErrorThreshold>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>