> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sync.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SAP HANA

export const CommonAuthSchemeOktaSso = ({siteName = "CData Sync", siteNameShort = "Sync", datasource = "the data source"}) => {
  return <>
      <p>To connect with single sign-on (SSO) via Okta, specify the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>OKTA</strong>.</li>
        <li><strong>User:</strong> Enter the username that you use to authenticate to your Okta account.</li>
        <li><strong>Password:</strong> Enter the password that you use to authenticate to your Okta account.</li>
        <li><strong>SSO Login URL:</strong> Enter the login URL that is used by your SSO provider.</li>
        <li><strong>SSO Properties:</strong> Enter a semicolon-separated list of the single sign-on (SSO) properties that you want to use (for example, <em>SSOProperty1</em>=<em>Value1</em>;<em>SSOProperty2</em>=<em>Value2</em>;...).</li>
      </ul>
    </>;
};

export const CommonAuthSchemePassword = ({siteName = "CData Sync", siteNameShort = "Sync", datasource = "the data source"}) => {
  return <>
      <p>To connect with your user credentials, set the following properties:</p>
      <ul>
        <li><strong>Auth Scheme:</strong> Select <strong>Password</strong>.</li>
        <li><strong>User:</strong> Enter the username that you use to authenticate to your {datasource} account.</li>
        <li><strong>Password:</strong> Enter the password that you use to authenticate to your {datasource} account.</li>
      </ul>
    </>;
};

export const CommonDatasourceMoreInformation = ({datasource = "the data source", advancedurl = "", siteName = "CData Sync", driverVersion = ""}) => {
  return <>
      <p>
        For more information about interactions between {siteName} and {datasource}, see{' '}
        <a href={`https://cdn.cdata.com/help/${advancedurl}${driverVersion}/synch/default.htm`}>
          {datasource} Connector for {siteName}
        </a>.
      </p>
    </>;
};

export const CommonDatasourceAddConnector = ({datasource = "the data source", title = "the connector", destination = false, siteNameShort = "Sync"}) => {
  return <>
      <p>
        To enable {siteNameShort} to use data from {datasource}, you first must add the
        connector, as follows:
      </p>
      <ol>
        <li>Open the <strong>Connections</strong> page of the {siteNameShort} dashboard.</li>
        <li>Click <strong>Add Connection</strong> to open the <strong>Select Connectors</strong> page.</li>
        <li>
          Click the <strong>{destination ? "Destinations" : "Sources"}</strong> tab and locate
          the <strong>{title}</strong> row.
        </li>
        <li>
          Click the <strong>Configure Connection</strong> icon at the end of that row to open
          the <strong>New Connection</strong> page. This action opens the{' '}
          <strong>Add Connection</strong> dialog box.
          <br />
          <strong>Note:</strong> If the <strong>Configure Connection</strong> icon is not
          available, click the <strong>Download Connector</strong> icon to install
          the {title} connector.
        </li>
        <li>Enter a name for your connection in the <strong>Add Connection</strong> dialog box.</li>
        <li>Click <strong>Add</strong> to open the <strong>Settings</strong> tab for your connector.</li>
      </ol>
      <p>
        For more information about installing new connectors, see{' '}
        <a href="../connections">Connections</a>.
      </p>
    </>;
};

export const CommonDatasourceIntroSource = ({datasource = "the data source", siteName = "CData Sync"}) => {
  return <p>
      You can use the {datasource} connector from the {siteName} application to capture data
      from {datasource} and move it to any supported destination. To do so, you need to add
      the connector, authenticate to the connector, and complete your connection.
    </p>;
};

export const driverVersion = "M";

export const siteNameShort = "Sync";

export const siteName = "CData Sync";

export const datasource = "SAP HANA";
export const pageTitle = "SAP HANA";
export const advancedurl = "SN";

<CommonDatasourceIntroSource datasource={datasource} siteName={siteName} />

## Add the SAP HANA Connector

<CommonDatasourceAddConnector datasource={datasource} title={pageTitle} destination={false} siteNameShort={siteNameShort} />

## Authenticate to SAP HANA

After you add the connector, you need to set the required properties.

* **Server:** Enter the name of the server that runs {datasource}.
* **Port:** Enter the port number for {datasource}. The default port value is **39013**.

{siteName} supports authenticating to {pageTitle} in several ways. Select your authentication method below to proceed to the relevant section that contains the authentication details.

* [**Password**](#password) (default)
* [**OKTA**](#okta)
* [**Kerberos**](#kerberos)

### Password

<CommonAuthSchemePassword siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### Okta

<CommonAuthSchemeOktaSso siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### Kerberos

To connect with Kerberos, specify these settings:

* **Auth Scheme:** Select **Kerberos**.
* **User:** Enter the username that you use to authenticate to your {datasource} account.
* **Password:** Enter the password that you use to authenticate to your {datasource} account.
* **Kerberos KDC:** Enter the host name or IP address of your Kerberos Key Distribution Center (KDC) machine.
* **Kerberos Realm:** Enter the Kerberos realm that you use to authenticate to Kerberos.
* **Kerberos SPN:** Enter the service principal name (SPN) for the Kerberos domain controller.
* **Kerberos User:** Enter the principal username (in the format ***Host*/*User*@*Realm***) for the Kerberos domain controller.
* (Optional) **Kerberos Keytab File:** Enter the full file path to your Kerberos keytab file.
* (Optional) **Kerberos Ticket Cache:** Enter the full file path to an MIT Kerberos credential cache file.

## Trigger-Based Change Data Capture for SAP HANA

{siteName} supports trigger-based change data capture (CDC) for SAP HANA sources.

When trigger-based CDC is enabled, {siteNameShort} creates database triggers on the selected source tables by using the permissions that are granted to the {siteNameShort} database user. These triggers capture INSERT, UPDATE, and DELETE operations and write each change to a centralized change-log table, which {siteNameShort} reads to replicate data efficiently and reliably.

When trigger-based CDC is enabled, {siteNameShort} performs the following actions:

* creates INSERT, UPDATE, and DELETE triggers on each selected source table
* captures row-level changes as they occur
* writes a record for each change to a global change-log table

### CDC Change-Log Table

All triggers that are created for CDC write to a single global change-log table:

* **Schema:** `_CDATA`
* **Table:** `_CDC_TRG_CHANGE_LOG`

This table is shared across all tracked tables and stores the complete row image for every change. For UPDATE operations, both the before and after values are recorded. For DELETE operations, all available row values are preserved to ensure complete change visibility and correct downstream replication.

### Authentication

Trigger-based CDC for SAP HANA supports only the **Password** authentication scheme.

### Prerequisites

Before you enable trigger-based CDC for SAP HANA, ensure that the following requirements are met:

* **Minimum driver version:** The CData SAP HANA driver version must be 25.0.9511 or later.
* **Schema support:** Tables that reside in system schemas are not supported. Schemas that match the patterns `SYS`, `SYS_*`, and `PUBLIC` are treated as system schemas and cannot be used for trigger-based CDC.
* **Database permissions:** The database user that is specified in the SAP HANA connection must have the following privileges:

  **Catalog access:**

  ```sql theme={null}
  GRANT CATALOG READ TO <ReplicationUser>;
  ```

  **Source schema privileges:**

  ```sql theme={null}
  GRANT SELECT ON SCHEMA <source_schema> TO <ReplicationUser>;
  GRANT TRIGGER ON SCHEMA <source_schema> TO <ReplicationUser>;
  ```

  **Change-log schema privileges (`_CDATA`):**

  The CDC engine writes change events to the `_CDATA._CDC_TRG_CHANGE_LOG` table. The required permissions depend on whether the replication user owns the `_CDATA` schema.

  * **The user owns the `_CDATA` schema:** No additional grants are required. The user automatically has full privileges on objects in schemas that the user owns.
  * **The user does not own the `_CDATA` schema:** Grant SELECT, INSERT, and DELETE privileges on the `_CDATA` schema, as follows:

    ```sql theme={null}
    GRANT SELECT, INSERT, DELETE ON SCHEMA _CDATA TO <ReplicationUser>;
    ```

These privileges allow {siteNameShort} to read system metadata, create and execute triggers on the selected source tables, and read from and maintain the `_CDATA._CDC_TRG_CHANGE_LOG` change-log table for CDC processing.

### Unsupported Data Types

Trigger-based CDC does not support columns that use the following SAP HANA data types:

* TEXT
* BINTEXT
* ST\_POINT
* ARRAY

SAP HANA does not allow triggers to reference these data types. As a result, columns that use these types are excluded from change capture.

### Enable Trigger-Based CDC for SAP HANA

To enable trigger-based CDC for a SAP HANA source in {siteNameShort}:

1. Create or edit a {siteNameShort} job that uses SAP HANA as the source.

2. Select the source tables that you want to replicate.

3. Enable CDC for the job, as explained in [Creating a CDC Job in {siteName}](../../jobs/change-data-capture#creating-a-cdc-job-in-cdata-sync)

   <Note>During job initialization, {siteNameShort} creates the required triggers and the `_CDATA._CDC_TRG_CHANGE_LOG` table if they do not already exist.</Note>

4. Run the job to begin capturing and replicating change events.

After CDC is enabled, {siteNameShort} continuously reads from the change-log table and applies INSERT, UPDATE, and DELETE operations to the destination.

### Trigger Management

The CDC engine automatically manages triggers for each task in the job, as follows:

* When a table is added to a job, {siteNameShort} creates the corresponding INSERT, UPDATE, and DELETE triggers.
* When a task or an entire job is removed, {siteNameShort} checks whether any remaining jobs still reference the same source tables. If no other jobs require those tables, {siteNameShort} drops the corresponding triggers.

  <Note>Although triggers and jobs can be dropped from {siteNameShort}, the `_CDATA._CDC_TRG_CHANGE_LOG` table is never dropped by the application.</Note>

### Schema Change Detection

The CDC engine monitors source table schemas for structural changes during each polling cycle. Before polling for data changes, the engine compares the current table metadata with a stored baseline to detect differences.

#### Detected Changes

The CDC engine treats the following supported column changes as breaking changes:

* A column is added.
* A column is removed.
* A column data type is changed.

Changes to unsupported columns are detected and logged but do not interrupt CDC processing.

#### CDC Engine Behavior When Schema Changes Occur

When the CDC engine detects a breaking schema change, it performs the following actions for the affected tables:

* drops stale triggers
* deletes stale rows from the \_CDATA.\_CDC\_TRG\_CHANGE\_LOG table
* stops the job with the status **Schema Changed** and reports the affected tasks

On the next job run:

* Each affected task is set to **REFRESHTABLE**, which causes the table to be fully reloaded and replication to restart from a new baseline.
* The CDC engine re-creates triggers that are based on the updated schema and establishes a new baseline.

Tables that are not affected by the schema change continue replicating without interruption.

#### Known Limitations

If a column that is referenced in a trigger definition is dropped while the CDC engine is stopped, write operations on the source table can fail.

This behavior occurs because the trigger becomes invalid when the column is removed. SAP HANA raises an error when the trigger executes, which can block INSERT, UPDATE, or DELETE operations until the CDC engine is restarted and the trigger is re-created to match the updated schema.

### Data Retention

The `_CDATA._CDC_TRG_CHANGE_LOG` table is shared by all CDC-enabled jobs. {siteNameShort} provides the following job-level properties to control retention and cleanup:

* **changelog.retention.hours:** Specifies how long change records are retained in the change-log table. The default retention time is 168 hours (seven days).
* **changelog.cleanup.interval.minutes:** Specifies how often {siteNameShort} scans the change-log table and removes expired records. The default interval is 60 minutes.

### SAP Client Filtering

In SAP ERP and SAP S/4HANA environments, client-dependent tables include the `MANDT` column, which stores the SAP client identifier.

To capture changes for a specific SAP client, you can set the **sap.client.id** job property (the default value is **null**).

When this property is set, {siteNameShort} filters change events based on the value of the `MANDT` column and processes only the rows that belong to the specified client.

## Complete Your Connection

To complete your connection:

1. Specify the following properties:
   * (Optional) **Database:** Enter the name of your {datasource} database.
   * (Optional) **Schema:** Enter the schema for your {datasource} database.
   * **Include System Objects:** Select whether you want to fetch HANA System schema and tables. By default, the **Enable** checkbox is not selected.
   * **Use SSL:** Select whether you want to enable Secure Sockets Layer (SSL). By default, the **Enable** checkbox is not selected.
2. Define advanced connection settings on the **Advanced** tab. (In most cases, though, you should not need these settings.)
3. Click **Create & Test** to create your connection.

## More Information

<CommonDatasourceMoreInformation datasource={datasource} advancedurl={advancedurl} siteName={siteName} driverVersion={driverVersion} />
