The following warning is logged in the Qlik Replicate log files:
The metadata for source table 'table name' is different than the corresponding MS-CDC Change Table. The table will be suspended.
Resolution
The base table and the CDC table on MS-CDC have changed.
When the source table is Truncated
- Stop the task
- Disable CDC for the table on the Source database, may require your DBA to run the query
Example:
exec sys.sp_cdc_disable_table
@Source_schema = 'dbo_schema', @Source_name = 'EMPLOYEE2_table', @capture_instance = 'all'
- Then from the source database, truncate the table (the example is for table EMPLOYEE2_table)
- Then from the target database, truncate the same table as the source. (or do a reload of the table after resuming the task, assume that your task is set to truncate on full load.)
- Resume the task
When source table uses DDL Change Handling feature
- On the source database, do the alter DDL change to the table (the example is for table EMPLOYEE2_table)
- Stop the task
- Disable CDC for the table on the Source database, may require your DBA to run the query
Example:
exec sys.sp_cdc_disable_table
@Source_schema = 'dbo_schema', @Source_name = 'EMPLOYEE2_table', @capture_instance = 'all'
- Resume the task
- If the table was suspended, then Unsuspend the table or reload the table.
Only the first DDL change will be picked up, will need to follow 'Truncation' steps if a DDL change is done while the table is suspended.
When source table uses Alternate source table DDL Change Handling feature
- Stop the task
- Disable CDC for the table on the Source database, may require your DBA to run the query
Example:
exec sys.sp_cdc_disable_table
@Source_schema = 'dbo_schema', @Source_name = 'EMPLOYEE2_table', @capture_instance = 'all'
- on the source database, modify the source table (the example is for table EMPLOYEE2_table)
- on the target database, modify the target table (the example is for table EMPLOYEE2_table)
- From the task, click on the drop down next to run, select advanced run option , and select : Start the task with metadata only run (Create missing tables and then stop). This will refresh the internal metadata without losing position.
- Enable MS-CDC for the table (if task is not set to do it automatically)
- Resume the task
If multiple tables need to be disabled, disable the CDC database.
Example (disable):
exec demo_s_database.sys.sp_cdc_disable_db;
Example (enable):
exec demo_s.dbo.sp_cdc_enable_db;
For SQL Server 2014
Option 1: Upgrade SQL to the latest version
Option 2: Add below column to each CDC table:
- Run this example:
Alter table table_cdc
Add [__$command_id] int
- Unsuspend all tables
- Uncheck the capture DDL events in advance table of the source MS-CDC, then save
- Reload the task
- The task will run as normal with CDC
Environment
Qlik Replicate
MS-CDC source endpoint
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.