Skip to main content

Oracle

Oracle datasources use the Oracle database driver in thin mode. No Oracle Instant Client installation is required.

Connection Configuration

URI Format

oracle://user:password@host:1521/service_name

Required Fields

FieldTypeDescription
connection_typestringMust be "oracle"
connection_sub_typestringMust be "database"
uristringOracle connection string
serverstringDatabase host address
databasestringOracle service name
usernamestringDatabase user
passwordstringDatabase password

Optional Fields

FieldTypeDefaultDescription
auth_modestringOracle authentication mode (e.g., "SYSDBA")
schemastringOracle schema name to query against

Environment Variables

VariableDescription
ORACLE_DEBUG_BOUNDARYEnable debug timing for Oracle query boundaries

Example Connection

{
  "name": "oracle-market-data",
  "connection_type": "oracle",
  "connection_sub_type": "database",
  "uri": "oracle://libuser:s3cureP@ss@db.example.com:1521/ORCL",
  "server": "db.example.com",
  "database": "ORCL",
  "username": "libuser",
  "password": "s3cureP@ss"
}

Dataset Configuration (data_args)

Required Fields

FieldTypeDescription
table_optionslistTables to query (see below)
databasestringConnection reference name
data_dt_columnstring or listColumn(s) containing the datetime value
data_dt_formatbool or string or listtrue for native datetime auto-detect, or strptime format
data_dt_timezonestringTimezone of the source data
data_key_columnstring or listColumn(s) used as the symbol/key for query filtering

Optional Fields

FieldTypeDefaultDescription
batch_sizeint10000Number of rows per query batch
data_dt_nudgeint0Microsecond offset applied to timestamps

table_options Entry

Each entry in table_options describes a table to query:
FieldTypeDescription
dbstringDatabase/service name
table_likestringTable name or pattern
tokenstringTable identifier token
zonestringTimezone, default "America/New_York"
dt_modestring(Optional) Datetime mode
dt_regexstring(Optional) Regex for partitioned tables
dt_formatstring(Optional) Datetime format for partitioned tables
nudge_microsint(Optional) Microsecond nudge

Complete Example

Connection

{
  "name": "oracle-trades",
  "connection_type": "oracle",
  "connection_sub_type": "database",
  "uri": "oracle://libuser:s3cureP@ss@oradb.example.com:1521/TRADEDB",
  "server": "oradb.example.com",
  "database": "TRADEDB",
  "username": "libuser",
  "password": "s3cureP@ss",
  "schema": "MARKET_DATA"
}

Dataset

{
  "name": "us-equity-trades",
  "connection": "oracle-trades",
  "data_args": {
    "table_options": [
      {
        "db": "TRADEDB",
        "table_like": "DAILY_TRADES",
        "token": "daily_trades",
        "zone": "America/New_York"
      }
    ],
    "database": "oracle-trades",
    "batch_size": 10000,
    "data_dt_column": "TRADE_TIME",
    "data_dt_format": true,
    "data_dt_timezone": "America/New_York",
    "data_dt_nudge": 0,
    "data_key_column": "SYMBOL"
  },
  "schema": [
    { "name": "SYMBOL", "type": "string", "group": "key", "description": "Ticker symbol" },
    { "name": "TRADE_TIME", "type": "string", "group": "time", "description": "Trade timestamp" },
    { "name": "PRICE", "type": "double", "group": "value", "description": "Trade price" },
    { "name": "VOLUME", "type": "int64", "group": "value", "description": "Trade volume" },
    { "name": "EXCHANGE", "type": "string", "group": "value", "description": "Exchange code" }
  ]
}
Oracle column names are uppercase by default. Use uppercase names in your schema definition and data_args fields to match Oracle’s metadata.

Authentication Modes

The auth_mode field supports Oracle authentication modes for privileged connections:
{
  "name": "oracle-admin",
  "connection_type": "oracle",
  "connection_sub_type": "database",
  "uri": "oracle://sys:adminP@ss@db.example.com:1521/ORCL",
  "server": "db.example.com",
  "database": "ORCL",
  "username": "sys",
  "password": "adminP@ss",
  "auth_mode": "SYSDBA"
}
Using SYSDBA authentication in production datasource connections is not recommended. Create a dedicated read-only user with SELECT privileges on the required tables.

Schema-Qualified Tables

When the schema field is set on the connection, CloudQuant Data Liberator queries tables within that schema. This is useful when the database user’s default schema differs from where the data resides:
{
  "schema": "MARKET_DATA",
  "table_options": [
    {
      "db": "TRADEDB",
      "table_like": "DAILY_TRADES",
      "token": "daily_trades",
      "zone": "America/New_York"
    }
  ]
}
This queries MARKET_DATA.DAILY_TRADES rather than relying on the user’s default schema.

Microsecond Timestamp Precision

Oracle TIMESTAMP(6) columns support microsecond precision. A custom-patched oracledb 3.4.0 is available for CloudQuant Data Liberator that preserves full microsecond precision during data extraction.
The standard Oracle database driver 3.3+ driver supports microsecond timestamps. The custom-patched 3.4.0 build provides additional optimizations for high-frequency timestamp extraction. Contact your CloudQuant Data Liberator administrator for the patched driver.

Driver and Dependencies

ComponentDetails
DriverOracle database driver 3.3+ (thin mode)
ProtocolOracle Net (TNS)
Arrow conversionVia Oracle driver native conversion
Oracle Client requiredNo (thin mode)
Default port1521
Thin mode connects directly to Oracle without requiring Oracle Instant Client. This simplifies deployment and eliminates native library dependencies.

Troubleshooting

Connection refused

Verify the Oracle listener is running and accepting connections on the specified host and port:
# Test port connectivity
nc -zv oradb.example.com 1521

# Test with sqlplus (if available)
sqlplus libuser/s3cureP@ss@oradb.example.com:1521/TRADEDB

ORA-12514: TNS listener does not currently know of service

The service name in the URI does not match any registered service on the Oracle listener. Verify the service name:
-- On the Oracle server
SELECT name FROM v$services;

ORA-01017: invalid username/password

Ensure the username and password are correct. Oracle passwords are case-sensitive (depending on the SEC_CASE_SENSITIVE_LOGON parameter).

Table not found (ORA-00942)

Check that the user has SELECT privileges on the target table and that the schema is correctly specified:
GRANT SELECT ON MARKET_DATA.DAILY_TRADES TO libuser;

Debug timing

To enable debug timing for Oracle query boundaries, set the environment variable:
export ORACLE_DEBUG_BOUNDARY=1
This logs timing information for each query phase, useful for diagnosing performance bottlenecks.

Slow queries

  • Increase batch_size for large result sets (up to 100000).
  • Ensure the datetime and key columns are indexed in Oracle.
  • For partitioned tables, verify that Oracle partition pruning is being used by checking the execution plan.
  • Use TIMESTAMP(6) columns for microsecond precision rather than DATE (which only supports second precision).