Learn 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.
The Oracle system must be reachable from the Exasol system
The user credentials in the connection must be valid.
Download Oracle Instant Client 12.1.0.2.0 from the Oracle website to your local machine.
Oracle Instant Client 12.1.0.2.0 is the only version supported in Exasol 7.1.
To create a connection, run the following statement. Replace the connection string and credentials as needed.
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)))';
To test the connection, run the following statement:
SELECT * FROM
(
IMPORT FROM ORA AT OCI_ORACLE
STATEMENT 'select ''Connection works'' from dual'
);
Download the compatible driver from the Oracle JDBC Driver Download Page .
Do the following to configure the driver in EXAoperation:
ORACLEoracle.jdbc.OracleDriverjdbc:oracle:thin:For more information about how to manage the JDBC driver through EXAoperation, see Manage JDBC drivers.
To create a connection, run the following statement. Replace the connection string and credentials as needed.
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:
SELECT * FROM
(
IMPORT FROM jdbc AT JDBC_ORACLE
STATEMENT 'select ''Connection works'' from dual'
);
Use IMPORT to load data from a table or SQL statement using the connection that you created.