CDC Streams · warning · dba

Foreign key checks are disabled for this CDC stream

Some CDC streams intentionally disable target foreign key checks so child rows can apply before parent rows. This can keep replication moving, but it increases the need for compare and repair checks.

Error Codes In Plain English

cdc_fk_checks_disabled: FK checks disabled for this CDC stream

What you might see

You may see a warning that FK checks are disabled, or drift/orphan rows during heavy CDC catch-up.

Why it usually happens

- Source changes arrive in an order that violates target FK constraints.
- Parent rows are delayed behind child rows.
- The target schema has stricter constraints than the source.
- Bulk catch-up is applying historical changes quickly.

How to fix it

1. Let the stream catch up if lag is decreasing.
2. Run Compare after the stream stabilizes.
3. Run Repair for drift or orphan rows.
4. Review schema differences if the same FK issue repeats.
5. Consider CDC batching/order tuning where available.

How to avoid it next time

Use scheduled compare/repair for CDC streams where FK checks are disabled. Review parent/child table inclusion together in mappings.

SQL to check

```sql
SELECT @@FOREIGN_KEY_CHECKS;
```