清理合併元資料(複製 Transact-SQL 程式設計)

適用於:SQL Server

合併代理程式 會根據出版品的保留設定定期清理合併複製的元資料。 此過程發生在MSmerge_genhistory、MSmerge_contents、MSmerge_tombstone、MSmerge_past_partition_mappings 及 MSmerge_current_partition_mappings 系統資料表中的 Publisher 與 Subscriber。 你也可以透過複製儲存程序程式化清理這些資料表中的資料。

若要手動清除合併中繼資料

  1. 在發行集資料庫的「發行者」端,執行 sp_mergemetadataretentioncleanup。

  2. (選擇性) 請注意在步驟 1 中從 MSmerge_genhistory、MSmerge_contents 和 MSmerge_tombstone 系統資料表所移除的資料列數目 (分別以 @num_genhistory_rows、@num_contents_rows 和 @num_tombstone_rows 輸出參數傳回)。

  3. 在「訂閱者」端重複步驟 1 和 2,以清除訂閱者資料庫上的中繼資料。