Sql Server Replication Monitor 提供一个feature,能够verify Replication的 Publication 和 Subscription 的数据同步status。

1,在Replication Monitor的Left pane中点击Repulication,弹出快捷菜单 "Validate Subscriptions...",开始Validate one subscription。

2,在Replication Monitor的Right pane中,选择一个Subscription,点开 View Details

3,查看 Distributor to Subscriber History tab的 Action Messages

如果显示的是 “Table 'xxx' passed rowcount(number) and checksum validation”,表示Validate 的result是success,Publication 和subscription 的数据是同步的。

如果显示的是 ”Table 'xxx' might be out of synchronization. Rowcounts(actual:number1, expected number2).Checksum values(actual:number3,expected number4)“ ,表示Validate的result 是 failure,Publication 和subscription 的数据是不同步的。

 

Here is the query that is being executed against each table in the database if you choose to compare actual count and the checksum:

SELECT count_big(*), 
    sum(convert(numeric, binary_checksum(*) ) ) 
FROM   WITH (TABLOCK HOLDLOCK)