Sep 13, 2023 10:49:03 AM
The Qlik Replicate SAP HANA source endpoint allows you to convert to using the log table with CDC changes. This article documents how to convert the existing triggers into Version 2 or CTS Mode Version 3.
Contact Qlik Support if you plan to convert your triggers, as additional migration steps may be needed to avoid data loss.
When a task is started for the first time with HANA Trigger Based and without “Log Table” it will create the following artifacts:
In “V1” mode, the INDX column of the attrep_cdc_changes table is used in the stream position for change data capture.
NOTE: The “V1” endpoint supports Advanced Run Start From Timestamp.
When Log Table is enabled (Advanced tab) the endpoint will be considered to be running in “V2” mode.
Migrated endpoints: For existing “V1” endpoints being migrated to “v2”, the customer must manually create the necessary attrep_cdc_log table and follow the instructions for switching into this mode. The underlying table triggers will still show “v1” in their name. If the “SAP Archiving User” filter is specified, the following steps will happen when the task using this endpoint is resumed:
Please contact Support for more migration instructions when moving from “V1” to V2”.
New endpoints: For brand new endpoints in new artifact schemas (no prior attrep* tables), the “V2” endpoint upon first usage will create both attrep_cdc_changes and attrep_cdc_log tables. All table triggers will be “v2”.
In “V2” mode, the $rowid$ column of attrep_cdc_log is used in the stream position for change data capture.
Artifacts involved in “V2” mode are:
NOTE: The “V2” endpoint does not support Advanced Run Start From Timestamp. Use the following special query to create the LSN for Advanced Run:
SELECT 'V1:'||MIN("$rowid$")||':'||MAX("$rowid$")||':0:'||MIN("$rowid$") AS "STREAM POSITION" from "$SCHEMA$"."attrep_cdc_log" WHERE "CHANGE_EVENT_TIME" >= 'YYYY-MM-DD HH:MM:SS'
NOTE that the LSN for “V1” and “V2” endpoints both start with “V1:”.
CTS Mode must be enabled on SAP HANA
A “V3” endpoint can be created, or a “V1” or “V2” endpoint can be modified. In both cases a new Feature Flag sapHanaCtsMode must be added and set to ON. In addition for the “V2” endpoint being converted to “V3” the “Log Table” Advanced parameter must be unchecked.
When the task using this endpoint is started for the first time the following steps will be performed:
- Table attrep_cdc_changes_cts will be created.
- “v3” triggers will be created for each table in the task list.
- The old “V1” and “V2” tables will not be removed.
- The old “v1” and/or “v2” triggers will not be removed.
- The internal LSNs will start with “V3:”.
- The stream position will be based on internal column $rowcts$ from table attrep_cdc_changes_cts.
Note that in order to avoid data loss when moving to V3, tables should be fully reloaded. Alternatively a set of migration steps may be carefully followed. Contact Support for those details.
Note that CTS Mode DOES support SAP Archive User filtering when specified on the endpoint.
Note that “V3” mode does support Advanced Run Start From Timestamp.
How to enable SAP HANA CTS Mode support in Qlik Replicate