Skip to content
DuckDB community extension

oracle_scanner

Read and write Oracle Database with no Oracle client

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 · SQL
INSTALL oracle_scanner FROM community;
LOAD oracle_scanner FROM community;

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

The connection lives in a secret, so credentials stay out of SQL text

SQL
-- The connection lives in a secret, so credentials stay out of SQL text
-- and query history. HOST/PORT/SERVICE_NAME, an Easy Connect string in
-- DSN, or an alias from tnsnames.ora all work.
CREATE SECRET ora (
    TYPE oracle,
    DSN 'db.example.com:1521/ORCLPDB1',
    USER 'scott',
    PASSWORD '...'
);

-- Run Oracle SQL and get the rows back as a DuckDB table.
SELECT * FROM oracle_query('ora', 'SELECT id, label FROM app.items');

-- Or attach the schema and use plain DuckDB SQL against it.
ATTACH 'ora' AS o (TYPE oracle_scanner);
SELECT * FROM o.ITEMS WHERE id > 100 ORDER BY id LIMIT 10;

-- Writes go through the same catalog, inside a real transaction.
INSERT INTO o.ITEMS SELECT * FROM 'new_items.parquet';

Provided by krokozyab. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

oracle_scanner reads and writes Oracle Database directly. It speaks Oracle's own network protocol (TNS/TTC) in C++, so there is no Oracle Instant Client, OCI, ODPI-C, ODBC, JDBC, Python runtime or helper process: INSTALL downloads one file and nothing else is needed on the machine or on the Oracle server.

Connect with a DuckDB secret: host, port and service name; an Easy Connect string or a full descriptor in DSN; an alias from tnsnames.ora (CONFIG_DIR, TNS_ADMIN); or an Autonomous Database wallet ZIP or folder, read in memory and never unpacked to disk. TCPS always verifies the certificate and host name.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
krokozyab/quack-oracle
License
Apache-2.0
Maintainers
krokozyab
Written in
C++
Build source
61a2b96f85d5
Build definition
Community descriptor