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.
The Oracle system must be reachable from the Exasol system
The user credentials in the connection must be valid.
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.
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 .
Create a configuration file called settings.cfg
with the following settings:
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.
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.