When a replication is set up, a replication cleanup task is automatically created on the distribution server for each publisher/subscriber pairing. For example, if three publishers use one remote distributor, and if one subscriber subscribes to various publications from all three publishers, then there are three cleanup tasks on the distributor (one to support each publisher/subscriber pairing).
Replication cleanup is an important task that helps replication to effectively function in a long-running environment. The replication cleanup task:
There is a parameter associated with the cleanup taskūthe retention periodūthat determines the period of time that transactions will be guaranteed to be retained within the distribution database after they have been distributed to a destination database. The setting of the retention period, in conjunction with scheduling implemented for backup of a subscription server, can be used to ensure that the information required to automatically recover a destination database is always available within the distribution database.
For example, if the subscription server POODLE has scheduled a transaction log dump of a destination database for once every 24 hours, you could set the retention period for POODLE's cleanup task to 48 hours. Then, even if POODLE experienced a catastrophic failure immediately before a scheduled backup, after restoring the server from the last available transaction log dump, all transactions necessary to automatically restore the replicated tables would still be available to the distribution process of the distribution server.
The first subscription established between a publisher/subscriber pair causes a replication cleanup task to be created on the distributor. This task is created using the existing setting for the retention period. Because of this, it is best to set the retention period before establishing any subscriptions for that publisher/subscriber pair.
The Distribution Options dialog box appears.
If the replication cleanup task already exists, you can (without dropping subscriptions) change the retention period by editing the cleanup task on the distributor.
The Task Scheduling dialog box appears.
For example AIREDALE_TERRIER_Cleanup.
The Task Editing dialog box appears.
There are four parameters in the command line for the cleanup task:
Enter a new retention period value. The number you enter represents hours. For example, type 48 to indicate a retention period of 48 hours.