Skip to main content Skip to complementary content

Prerequisites

Before SAP HANA can be used as a source endpoint in a replication task, the prerequisites described in this section must be met.

Information note

SAP HANA ODBC driver 2.13 and later are not supported.

Port

Open inbound port number 3xx15 to the SAP HANA server where xx is the instance number of the SAP HANA database that contains the source tables.

For example, the port for instance 90 would be 39015.

Required clients

Windows

Install the SAP HANA ODBC 64-bit Driver 2.x for Windows on the Replicate Server machine. The driver name is HDBODBC.

Linux

Download the SAP HANA ODBC 64-bit Driver 2.x from the SAP Software Download Center. You must have an account with SAP to download the software.

Example driver name: HDBODBC

Then, open a shell prompt and do the following:

  1. Stop the Replicate service:

    ./areplicate stop
  2. Optionally, confirm that the service has stopped:

    ./areplicate status
  3. Install the SAP HANA ODBC 64-bit Driver 2.x for Linux on the Replicate machine.

  4. Add the following section to the odbcinst.ini file located in directory /etc:

    [HDBODBC]

    Description=64-bit HANA ODBC Driver

    Driver=/opt/sap/hdbclient/libodbcHDB.so

    fileUsage=1

  5. Start the Replicate service:

    ./areplicate stop
  6. Optionally, confirm that the service has started:

    ./areplicate status

Capturing data changes

Changes can be captured from SAP HANA using either of the following methods:

  • Trigger-based
  • Log-based

The prerequisites for both of these methods are described below.

Trigger-based

Replicate requires the following artifacts to be created in the source database (either manually by the DBA or automatically by Replicate):

  • Three triggers for each of the designated source tables: The triggers capture changes to the source tables (INSERTs, UPDATEs, and DELETEs) and write them to the Replicate attrep_cdc_changes table described below. A separate trigger is required for each DML operation.

    The triggers will be created in the source table schema.

  • The Replicate attrep_cdc_changes table: This table will contain changes captured by the triggers and will either be created in the schema of the user specified in the General tab of the SAP HANA endpoint settings, or in the schema specified in the endpoint settings' Advanced tab.

    Information note

    As Replicate periodically scans the attrep_cdc_changes table for changes, the number of UPDATEs shown in the monitor's Change Processing tab reflects the number of UPDATEs found (in the attrep_cdc_changes table) at the time of scanning. This may not be the actual number of UPDATEs performed on the source since UPDATEs are sometimes merged with INSERTs (depending on when the attrep_cdc_changes table was last scanned).

  • The Replicate attrep_cdc_log table: When the Use log table option in the SAP HANA endpoint's Advanced tab is enabled, changes are copied from the attrep_cdc_changes table to the attrep_cdc_log table. During the task, Replicate reads the changes from the attrep_cdc_log table and deletes the old data according to the cleanup settings (specified in the endpoint's Advanced tab). The table will either be created in the schema of the user specified in the General tab of the SAP HANA endpoint settings, or in the schema specified in the endpoint settings' Advanced tab.

To create the CDC artifacts automatically (the default):

  • When defining the SAP HANA source endpoint, make sure that the Create CDC Artifacts check box in the Advanced tab is selected (the default).

To create the CDC artifacts manually:

  1. Define the task as you would any other Replicate task, but when configuring the SAP HANA source endpoint, clear the Create CDC Artifacts check box in the Advanced tab.
  2. Once the task is defined, select any of the Metadata only options in the Advanced Run Options window, and then click OK.

    The task will run and generate the scripts for creating the CDC artifacts in the following location and then stop:

    ~/data/tasks/<task_name>/scripts

  3. Execute the scripts in the source database.
  4. Run the Replicate task normally.
Information note

Capturing changes from SAP HANA requires the source tables to have a Primary Key or Unique Index.

Log-based

  • Supported from SAP HANA 2.0 SPS 04
  • Redo and backup logs:
    • The logs must be in their original format only
    • The log folders must be shared with the Replicate machine.

See also: Required permissions

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!