Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server
The Merge Agent periodically cleans up merge replication metadata based on the retention setting for the publication. This process occurs at the Publisher and Subscriber in the MSmerge_genhistory, MSmerge_contents, MSmerge_tombstone, MSmerge_past_partition_mappings, and MSmerge_current_partition_mappings system tables. You can also clean up the data in these tables programmatically by using replication stored procedures.
To manually clean up merge metadata
At the Publisher on the publication database, execute sp_mergemetadataretentioncleanup.
(Optional) Note the number of rows removed in step 1 from the MSmerge_genhistory, MSmerge_contents, and MSmerge_tombstone system tables, returned respectively in the
@num_genhistory_rows,@num_contents_rows, and@num_tombstone_rowsoutput parameters.Repeat steps 1 and 2 at the Subscriber to clean up metadata on the subscription database.