Load data from Oracle

This article explains how to connect to an Oracle database with Exasol and load data.

To know more about data type mappings and how to migrate data, see the Oracle to Exasol migration script in our GitHub repository.

We recommend using Oracle Call Interface (OCI) with Oracle Instant Client instead of Oracle JDBC to connect to Exasol. This article describes both methods.

Prerequisites

Oracle Call Interface (OCI)

Download and add Oracle Instant Client

Follow the procedure described in Add Oracle Instant Client to add the thin client to your Exasol deployment. The method is identical for all deployment platforms.

Create and test connection

To create a connection, run the following statement. Replace the connection string and credentials as needed.

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

Alternatively, run the following statement:

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

To test the connection, run the following statement:

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

Oracle JDBC

Download JDBC driver

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

Add JDBC driver

Create a configuration file called settings.cfg with the following settings:

Copy
DRIVERNAME=Oracle
PREFIX=jdbc:oracle:thin:
FETCHSIZE=100000
INSERTSIZE=-1

To know how to upload the JDBC driver and the configuration file to BucketFS, see Add JDBC Driver.

If the connection using the Oracle JDBC driver is unsuccessful, try disabling the security manager by adding the line NOSECURITY=YES to the settings.cfg file.

Create and test connection

To create a connection, run the following statement. Replace the connection string and credentials as needed.

Copy

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

To test the connection, run the following statement:

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

Load data

Use IMPORT to load data from a table or SQL statement using the connection that you created.