> ## 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.

# Oracle (Native)

export const CommonDatasourceMoreInformation = ({datasource = "the data source", advancedurl = "", siteName = "CData Sync", driverVersion = ""}) => {
  return <>
      <p>
        {siteName} と{datasource} の連携について、詳しくは{' '}
        <a href={`https://cdn.cdata.com/help/${advancedurl}${driverVersion}/jp/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>
        {siteNameShort} で{datasource} のデータを使用できるようにするには、まず以下の手順でコネクタを追加する必要があります：
      </p>
      <ol>
        <li>{siteNameShort} のダッシュボードから<strong>接続</strong>ページを開きます。</li>
        <li><strong>接続を追加</strong>をクリックして<strong>コネクタを選択</strong>ページを開きます。</li>
        <li>
          <strong>{destination ? "同期先" : "データソース"}</strong>タブをクリックして
          <strong>{title}</strong> 行に移動します。
        </li>
        <li>
          行末にある<strong>接続を設定</strong>アイコンをクリックして、<strong>新しい接続</strong>ページを開きます。この操作により、{' '}
          <strong>接続を追加</strong>ダイアログボックスが開きます。
          <br />
          <strong>Note：</strong> <strong>接続を設定</strong>アイコンが表示されない場合は、<strong>コネクタをダウンロード</strong>アイコンをクリックして {title} コネクタをインストールしてください。
        </li>
        <li><strong>接続を追加</strong>ダイアログボックスに接続名を入力します。</li>
        <li><strong>追加</strong>をクリックして、コネクタの<strong>設定</strong>タブを開きます。</li>
      </ol>
      <p>
        新しいコネクタのインストールについての詳細は、{' '}
        <a href="../connections">接続</a>を参照してください。
      </p>
    </>;
};

export const CommonDatasourceIntroSource = ({datasource = "the data source", siteName = "CData Sync"}) => {
  return <p>
      {siteName} アプリケーションから{datasource} コネクタを使用して、{datasource} からデータを取得してサポートされている任意の同期先に移動できます。これを行うには、コネクタを追加し、コネクタへの認証を行い、接続を完了する必要があります。
    </p>;
};

export const driverVersion = "M";

export const siteNameShort = "Sync";

export const siteName = "CData Sync";

export const datasource = "Oracle";
export const pageTitle = "Oracle (Native)";
export const advancedurl = "SO";

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

<Note>This connection can be used <u>only as a source</u> for the **Change Data Capture** job type.</Note>

## Prerequisites

Before you add and set up the {datasource} source connector, you need to set up the {datasource} database for change data capture (CDC), as explained in the following sections.

### Requirements

Before you set up {datasource} for CDC, ensure that you have one of the following supported versions: 12c, 19c, and 21c.

### Limitations on Incremental Replication

The {datasource} connector cannot capture data changes from the following schemas:

* appqossys
* audsys
* ctxsys
* dvsys
* dbsfwuser
* dbsnmp
* qsmadmin\_internal
* lbacsys
* mdsys
* ojvmsys
* olapsys
* orddata
* ordsys
* outln
* sys
* system
* vecsys (Oracle 23+)
* wmsys
* xdb

The connector also cannot capture changes for certain tables:

* nested tables
* index-organized tables with names that have a prefix of SYS\_IOT\_OVER\_
* spatial tables with names that start with MDRT\_, MDRS\_, or MDXT\_
* Compression Advisor tables that match this pattern: `CMP[3|4]$[0-9]+`

### Set Up Oracle for CDC

Perform the following steps to enable Oracle LogMiner for tracking changes via CDC capability in {siteNameShort}:

1. Enable ARCHIVELOG mode on your database. To determine whether ARCHIVELOG mode is enabled already, submit the following statement:

   ```
   SELECT LOG_MODE FROM V$DATABASE
   ```

   If the output from this statement does not show ARCHIVELOG as the log mode, submit the following statements to enable ARCHIVELOG mode:

   ```
   SHUTDOWN IMMEDIATE;
   STARTUP MOUNT;
   ALTER DATABASE ARCHIVELOG;
   ALTER DATABASE OPEN;
   ```

2. Ensure that the database retains backups and archive logs for at least twenty-four hours. CData recommends retaining backups and logs for seven days, as shown in this example:

   ```
   RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
   ```

3. Enable minimal supplemental logging (must be enable at the database level).

   ```
   ALTER DATABASE ADD SUPPLEMENTAL LOG DATA
   ```

4. Enable supplemental logging for every table.

   ```
   ALTER TABLE SchemaName.TableName ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS
   ```

   <Note>You can enable supplemental logging for the entire database, as well. However, CData does not recommend that because doing so generates a significant volume of logs. This behavior affects performance because it substantially increases the time that is required to process those logs.</Note>

5. Grant your user permission to run Oracle LogMiner by following the instructions below for your specific database.

   **Standalone Databases**

   Submit the following commands to grant permissions to run Logminer:

   ```
   -- connect to the database with 'sys as SYSDBA'
   CREATE TABLESPACE logminer_tbs DATAFILE '/opt/oracle/oradata/ORCL/logminer_tbs.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
   CREATE USER <Username> IDENTIFIED BY <Password> DEFAULT TABLESPACE logminer_tbs QUOTA UNLIMITED ON logminer_tbs ;    

   GRANT CREATE SESSION TO <Username>; 
   GRANT SELECT ON V_$DATABASE to <Username>; 
   GRANT FLASHBACK ANY TABLE TO <Username>; 
   GRANT SELECT ANY TABLE TO <Username>; 
   GRANT SELECT_CATALOG_ROLE TO <Username>; 
   GRANT EXECUTE_CATALOG_ROLE TO <Username>; 
   GRANT SELECT ANY TRANSACTION TO <Username>; 
   GRANT LOGMINING TO <Username>; 
   GRANT CREATE TABLE TO <Username>;      
   GRANT CREATE SEQUENCE TO <Username>; 
   GRANT EXECUTE ON DBMS_LOGMNR TO <Username>; 
   GRANT EXECUTE ON DBMS_LOGMNR_D TO <Username>; 
   GRANT SELECT ON V_$LOG TO <Username>; 
   GRANT SELECT ON V_$LOG_HISTORY TO <Username>; 
   GRANT SELECT ON V_$LOGMNR_LOGS TO <Username>; 
   GRANT SELECT ON V_$LOGMNR_CONTENTS TO <Username>; 
   GRANT SELECT ON V_$LOGMNR_PARAMETERS TO <Username>; 
   GRANT SELECT ON V_$LOGFILE TO <Username>; 
   GRANT SELECT ON V_$ARCHIVED_LOG TO <Username>; 
   GRANT SELECT ON V_$ARCHIVE_DEST_STATUS TO <Username>; 
   GRANT SELECT ON V_$TRANSACTION TO <Username>; 
   GRANT SELECT ON V_$MYSTAT TO <Username>; 
   GRANT SELECT ON V_$STATNAME TO <Username>;
   ```

   **Multi-tenant Databases**

   Submit the following commands to grant permissions to run Logminer:

   ```
   -- connect to the root container as 'sys as SYSDBA' and create a tablespace
   CREATE TABLESPACE logminer_tbs DATAFILE '/opt/oracle/oradata/ORCLCDB/logminer_tbs.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

   -- connect to your PDB as 'sys as SYSDBA' and create a tablespace with the same name
   CREATE TABLESPACE logminer_tbs DATAFILE '/opt/oracle/oradata/ORCLCDB/ORCLPDB1/logminer_tbs.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

   -- reconnect to the root container as 'sys as SYSDBA' and create a common user with access to all containers
   CREATE USER <CommonUser> IDENTIFIED BY <Password> DEFAULT TABLESPACE logminer_tbs QUOTA UNLIMITED ON logminer_tbs CONTAINER=ALL;

   GRANT CREATE SESSION TO <CommonUser> CONTAINER=ALL; 
   GRANT SET CONTAINER TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$DATABASE to <CommonUser> CONTAINER=ALL; 
   GRANT FLASHBACK ANY TABLE TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ANY TABLE TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT_CATALOG_ROLE TO <CommonUser> CONTAINER=ALL; 
   GRANT EXECUTE_CATALOG_ROLE TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ANY TRANSACTION TO <CommonUser> CONTAINER=ALL; 
   GRANT LOGMINING TO <CommonUser> CONTAINER=ALL; 
   GRANT CREATE TABLE TO <CommonUser> CONTAINER=ALL;      
   GRANT CREATE SEQUENCE TO <CommonUser> CONTAINER=ALL; 
   GRANT EXECUTE ON DBMS_LOGMNR TO <CommonUser> CONTAINER=ALL; 
   GRANT EXECUTE ON DBMS_LOGMNR_D TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$LOG TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$LOG_HISTORY TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$LOGMNR_LOGS TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$LOGMNR_CONTENTS TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$LOGMNR_PARAMETERS TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$LOGFILE TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$ARCHIVED_LOG TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$ARCHIVE_DEST_STATUS TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$TRANSACTION TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$MYSTAT TO <CommonUser> CONTAINER=ALL; 
   GRANT SELECT ON V_$STATNAME TO <CommonUser> CONTAINER=ALL; 
   ```

   <Note>An example of a common username is **C##LMUSER**.</Note>

6. Restart your database.

### Configure Row Identification for Tables without Primary Keys

For Oracle CDC jobs on tables without a primary key, {siteNameShort} uses the Oracle `ROWID` pseudocolumn to populate the `_cdatasync_id` column. Using `ROWID` enables {siteNameShort} to uniquely identify rows and apply update and delete operations correctly during CDC, even when no primary key is defined.

By default, the [`SyncIdSourceColumn` job option](../../jobs/advanced-job-options#additional-options) is set to `OracleRowId`. To use an MD5-based row hash instead, set the following job option in the **Additional Options** field on the job's **Advanced** tab:

```
SyncIdSourceColumn=RowHash
```

## Oracle コネクタを追加

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

## Oracle への認証

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

{siteName} supports authenticating to {datasource} in a few ways. Select connection type below to proceed to the relevant section that contains the connection details.

* [**Service Identifier**](#security-identifier-sid) (default)
* [**Service Name**](#service-name)
* [**Data Source**](#data-source)

### Security Identifier (SID)

To connect to {datasource} resources by using a SID, specify the following settings:

* **User:** Enter the username that you use to authenticate to the {datasource} database.
* **Password:** Enter the password that you use to authenticate to the {datasource} database.
* **Server:** Enter the host name or IP address of the server that hosts the {datasource} database. The default server is **localhost**.
* **Port:** Enter the port number for the {datasource} server. The default port is **1521**.
* **SID:** Enter the SID for your {datasource} database. The default SID is **ORCL**.

### Service Name

To connect to {datasource} resources by using a service name, specify the following settings:

* **User:** Enter the username that you use to authenticate to the {datasource} database.
* **Password:** Enter the password that you use to authenticate to the {datasource} database.
* **Server:** Enter the host name or IP address of the server that hosts the {datasource} database. The default server is **localhost**.
* **Port:** Enter the port number for the {datasource} server. The default port is **1521**.
* **Service:** Enter the service name for your {datasource} database. The default SID is **ORCL**.

  To obtain the service name, submit the following query from the Oracle SQL\*PLUS command line:

  `SELECT * FROM global_name;`

  <Note>The result of this query returns the global database name, which might not always align with the service name that is defined in the Oracle listener. If there is any uncertainty, verify the result with your DBA or review the tnsnames.ora file to confirm the correct service name.</Note>

### Data Source

To connect to {datasource} resources by using a data source, specify the following settings:

* **User:** Enter the username that you use to authenticate to the {datasource} database.
* **Password:** Enter the password that you use to authenticate to the {datasource} database.
* **Data Source:** Enter the data source for your {datasource} database.

## 接続を完了する

To complete your connection:

1. Define advanced connection settings on the **Advanced** tab. (In most cases, though, you should not need these settings.)
2. Click **Create & Test** to create your connection.

## 詳細について

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