This article explains how to use the tablediff command-line utility to verify data consistency between an Amazon RDS for SQL Server primary instance and its asynchronous read replicas. It details why relying solely on synchronization health metrics is insufficient for data parity verification and provides a methodology for generating remediation scripts to correct potential row-level divergence.
Key points
Asynchronous-commit read replicas in SQL Server AGs report health based on log transport status, not row-level data consistency.
The tablediff utility provides independent, row-level verification by performing a deterministic scan of table pairs.
When comparing large tables with LOB columns, create filtered views to exclude large data types and optimize comparison performance.
Generated remediation scripts require manual transaction wrapping and validation guard clauses before execution to ensure safety.
Relying on LSN (Log Sequence Number) matching is insufficient for regulatory audit requirements which may necessitate explicit data parity verification.