Oracle JDBC Catalog
Run catalog SQL with a warehouse SQL user that can manage catalogs and access the source. Ensure network access from the warehouse to metadata, storage, and source endpoints. For connector deployment, host files, JVM settings, or service configuration changes, contact VeloDB Cloud support.
Apache JDBC Catalog supports connecting to Oracle databases via the standard JDBC interface. This document describes how to configure Oracle database connections.
For an overview of JDBC Catalog, please refer to: JDBC Catalog Overview
Usage notes
To connect to an Oracle database, you need
-
Oracle 19c, 18c, 12c, 11g, or 10g.
-
The JDBC driver for Oracle databases, which you can download from the Maven Repository for Ojdbc8 and above versions of the Oracle JDBC driver.
-
Network connection between each FE and BE node of Apache Doris and the Oracle server, with the default port being 1521; if Oracle RAC is ONS-enabled, port 6200 is also required.
Connect to Oracle
CREATE CATALOG oracle_catalog PROPERTIES (
'type' = 'jdbc',
'user' = 'username',
'password'='pwd',
'jdbc_url' = 'jdbc:oracle:thin:@example.net:1521:orcl',
'driver_url' = 'ojdbc8.jar',
'driver_class' = 'oracle.jdbc.driver.OracleDriver'
)
jdbc_url defines the connection information and parameters to be passed to the JDBC driver. When using the Oracle JDBC Thin driver, the syntax of the URL may vary depending on your Oracle configuration. For example, if you are connecting to an Oracle SID or Oracle service name, the connection URL will differ. For more information, please refer to the Oracle Database JDBC Driver Documentation. The above example URL connects to an Oracle SID named orcl.
Hierarchical mapping
When mapping Oracle, a Database in Apache Doris corresponds to a User in Oracle. And a Table under a Database in Apache Doris corresponds to a Table accessible by that User in Oracle. The mapping relationship is as follows:
| VeloDB Cloud | Oracle |
|---|---|
| Catalog | Database |
| Database | User |
| Table | Table |
Column type mapping
| Oracle Type | VeloDB Cloud Type | Comment |
|---|---|---|
| number(P) / number(P, 0) | tinyint/smallint/int/bigint/largeint | VeloDB Cloud will choose the corresponding type based on the size of P: P < 3: TINYINT; P < 5: SMALLINT; P < 10: INT; P < 19: BIGINT; P > 19: LARGEINT |
| number(P, S), if (S > 0 && P > S) | decimal(P, S) | |
| number(P, S), if (S > 0 && P < S) | decimal(S, S) | |
| number(P, S), if (S < 0) | tinyint/smallint/int/bigint/largeint | In the case of S < 0, VeloDB Cloud will set P to `P + |
| number | VeloDB Cloud currently does not support the number type without specified P and S | |
| decimal(P, S) | decimal(P, S) | |
| float/real | double | |
| date | date | |
| timestamp | datetime(S) | |
| timestamp(s) with time zone / timestamp(s) with local time zone | DATETIME(S) / TIMESTAMPTZ(S) | DATETIME(S) by default; TIMESTAMPTZ(S) when enable.mapping.timestamp_tz = true. Precision is capped at 6. A future release makes the instant-preserving mapping unconditional. |
| char/nchar | string | |
| varchar2/nvarchar2 | string | |
| long/raw/long raw/internal | string | |
| BLOB | STRING / VARBINARY | STRING by default; VARBINARY when enable.mapping.varbinary = true. A future release makes the binary mapping unconditional. |
| other | UNSUPPORTED |
Common issues
-
ONS configuration failedoccurs when creating or querying Oracle CatalogContact VeloDB Cloud support to review
-Doracle.jdbc.fanEnabled=falseand the managed Oracle JDBC driver version. -
Non supported character set (add orai18n.jar in your classpath): ZHS16GBKexception occurs when creating or querying Oracle CatalogContact VeloDB Cloud support to install the matching Oracle globalization library
orai18n.jarand coordinate any required service restart.