Comparison and Reconciliation Strategies

DA server comparison strategies and reconciliation help you plan and manage your row and schema comparison jobs.

The comparison and reconciliation phases in DA server include:
  • Initial comparison
  • In-flight data option
  • Verify differences
  • Reconciliation

Initial Comparison

During an initial comparison, which is mandatory for all jobs, the DA agent fetches rows from source and target databases using a query. You can specify row comparison in DA server by specifying any of these options:
  • Column hash (column_hash) – each column value gets its own hash.
  • Row hash (row_hash) – hashes multiple column values into a single hash.
  • Literal compare – compares the full column data (value-to-value).
  • Mixed-compare mode – compares some columns by hash, and others by literal comparison.
Note: Some, such as column_hash and row_hash, apply only to row comparison jobs.

In-Flight Data Option

Row differences may arise during comparison, due to data being in flight during replication. DA server lets you recheck row differences, by selecting row data only from the target database; you need not run a full table check.

Row differences are classified into three types:
  • Missing – a row in the primary table is not present in the replicate table.
  • Orphaned – a row in the replicate table is not present in the primary table.
  • Inconsistent – a row is present in both tables, but the column data is different.

If DA server identified row differences in the initial comparison, an in-flight data comparison rechecks those rows to verify whether the differences have been reconciled. This is important, especially in replication environments where there are time lags in updating target databases.

In-flight data comparisons, which are optional, apply a “wait and retry” technique to any number of rows that shows data discrepancy during the initial comparison. For example, if an initial comparison at 8:00 p.m. reveals an out-of-sync row, and the wait period is 120 seconds, the recomparison is not started until 8.02 p.m to allow replication to apply any in-flight changes to that row.
Note: In-flight comparisons do not impact the source database. All source rows which differed are cached for recomparison against rows that are reselected from the target database.

Verify Differences

DA server fetches the literal data of all rows that differ between the source and target databases, and writes it to a column log. When you create a job, enable this option by setting CREATE_COL_LOG to true. A column log lists all the missing, orphaned, and inconsistent row values (keys and columns).

Reconciliation

Based on your job settings, you can reconcile the data differences—either automatically or by generating a reconciliation script. DA server verifies the differences and generates a SQL statement that ensures the target table is in the same state as the source table. Based on the row difference type, DA server runs:
  • insert statements on the target table for missing rows.
  • delete statements on the target table for orphaned rows.
  • update statements on the target table for inconsistent rows.
Related reference
Row Comparison Optimization