This document describes the steps to follow to resume replication following a DDL change that results in a table structure change.
CDC maintains and depends on metadata describing source and target tables and columns being replicated. When DDL changes occur which results in the table representation in the log to differ versus the image currently in the CDC metadata (usually due to a change to the source table structures), the metadata no longer contains the correct information with which to read source database log records to capture change data during mirroring.
For that reason, following a DDL change that results in table structural changes, some action is required to update the metadata before replication can be performed or resumed. This document describes how to update table definitions to accommodate a DDL change so that replication can proceed.
Planned DDL StepsFor a planned DDL change, first perform the following three steps (A,B,C), and then perform the Unplanned DDL steps.
- Step A: For a planned DDL execution, end all DML activity on all of the tables being altered.
- Step B: Ensure there are no open transactions involving the table being altered.
- Step C: End replication for all running subscriptions in the instance. Stop all subscriptions at head of log using the scheduled end-controlled shutdown.
- Step D: Follow the ‘Unplanned DDL Steps’ to complete the procedure
Unplanned DDL Steps
Note: If a table is shared in multiple subscriptions and at least one of those subscriptions is using a private scraper, then wait for the private scraper to hit the same DDL detected error before following the next steps (step 2 onwards). If you do not, you must refresh the table for those subscriptions that used a private scraper.
Was this topic helpful?
14 May 2020