Load data from Oracle

This section explains how to connect a Oracle database with Exasol and load data.

We recommend that you use Oracle Call Interface instead of Oracle JDBC to connect to Exasol.

For details about data type mappings or to migrate data, see the Oracle to Exasol migration script in our GitHub repository.

Oracle Call Interface

Download driver

Download the Oracle instant client version compatible with your Exasol version from the Oracle Instant Client Download page.

To know the compatible version of Oracle instant client, open EXAoperation, and select Software. Under the Versions, you can see the exact instant client version number. For example, as shown in the below image, the version of the instant client required is instantclient-basic-linux.x64-12.1.0.2.0

Instant Client Version

Configure the Client in EXAoperation

Do the following to configure the driver in EXAoperation:

  1. Log in to EXAoperation user interface as an Administrator user.
  2. Select Configuration > Software > Versions tab.
  3. Locate the downloaded Oracle client and click Submit to upload the driver.

    Connect Oracle OCI to Exasol

Run statements

Run the following statements from an SQL client to test the connection.

The Oracle system must be reachable from the Exasol system and the user must exist on the Oracle system.

Create a connection

To create a connection, run the following statement:

CREATE OR REPLACE CONNECTION OCI_ORACLE
    TO '192.168.99.103:1521/xe'
    USER 'system'
    IDENTIFIED BY 'oracle';

Alternatively, run the following statement:

CREATE CONNECTION OCI_ORACLE TO '(DESCRIPTION =  
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.99.103)(PORT = 1521)) 
      (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = orcl)))';

Test connection

To test the connection, run the following statement:

SELECT * FROM 
(
IMPORT FROM ORA AT OCI_ORACLE
STATEMENT 'select ''Connection works'' from dual'
);

Oracle JDBC

Download driver

Download the compatible driver from the Oracle JDBC Driver Download Page link.

Configure the driver in EXAoperation

Do the following to configure the driver in EXAoperation:

  1. Log in to EXAoperation user interface as an Administrator user.
  2. Select Configuration > Software and click the JDBC Drivers tab.
  3. Click Add to add the JDBC driver details
  4. Enter the following details for the JDBC properties:
    • Driver Name: ORACLE
    • Main Class: oracle.jdbc.OracleDriver
    • Prefix: jdbc:oracle:thin:
    • Disable Security Manager: Leave this option unchecked.
    • Comment: This is an optional field.
  5. Click Add button to save the details.
  6. Select the radio button next to the driver from list of JDBC driver.
  7. Click Choose File to locate the downloaded driver and click Upload to upload the JDBC driver.

For more information about how to manage the JDBC driver through EXAoperation, see Manage JDBC Drivers.

Run statements

To test the connection, run the following statements from an SQL client.

The Oracle system must be reachable from the Exasol system and the user must exist on the Oracle system.

Create connection

CREATE CONNECTION JDBC_ORACLE
TO 'jdbc:oracle:thin:@//10.78.0.178:1521/orcl'
USER 'exatest'
IDENTIFIED BY 'test';

Test connection

SELECT * FROM 
(
IMPORT FROM jdbc AT JDBC_ORACLE
STATEMENT 'select ''Connection works'' from dual'
);

Load data

You can use the IMPORT statement to load data using the connection you created above. IMPORT supports loading data from a table or a SQL statement.