Subscription Deactivation and Expiration

SQL Replication

Replication

Subscription Deactivation and Expiration

Subscriptions can be deactivated or can expire if they are not synchronized within a specified period of time. The action that occurs depends on the type of replication and the retention period that is exceeded.

Snapshot and Transactional Replication Subscriptions

If a subscription is not synchronized within a specified period of time, there is a possibility the subscription may get deleted or it may be automatically marked deactivated and require reinitialization. Whether it expires and is deleted or gets marked deactivated and requires initialization depends upon whether it exceeds the subscription expiration property of the publication or the maximum transaction retention property of the distribution database as well as whether or not it is an anonymous subscription.

Subscription Deactivation

When a subscription is not synchronized (for example, the Distribution Agent for it has not run or cannot connect to the Subscriber) within the maximum transaction retention period of the distribution database and there are changes in the distribution database waiting to be picked up, the subscription will be marked deactivated by the Distribution Cleanup Agent that runs on the Distributor. The default for maximum transaction retention period is 72 hours for transactional replication and the Distribution Cleanup Agent runs every 10 minutes by default.

If there is no activity at the Publisher, subscriptions will not be deactivated even if they have not been synchronized within the distribution retention period. After a subscription is marked inactive, the Distribution Agent will fail with an error message that informs the user that the subscription has been deactivated and that it needs to be reinitialized. The subscription will then need to be reinitialized and a new snapshot applied at the Subscriber before replication continues for that subscription.

In addition to deactivating subscriptions that have not synchronized within the maximum transaction retention period of the distribution database, the Distribution Cleanup Agent is also responsible for cleaning up transactions in the distribution database that have been delivered to Subscribers with named subscriptions.

If anonymous subscriptions are used, this agent will clean up only transactions in the distribution database that have exceeded the maximum transaction retention period. The Distribution Cleanup Agent will not clean up transactions in the distribution database before the end of the retention period when anonymous subscriptions are used because it cannot be sure that the Subscribers using anonymous subscriptions have received the transactions stored in the distribution database. If you set the retention period to a high value, the distribution database will grow larger if you are using anonymous subscriptions because of this.

To modify a Distributor or add or modify a distribution database