Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for ClickHouse®
  • Getting started
    • All tutorials
    • Adding data to a DB
    • Migrating data to Managed Service for ClickHouse® using ClickHouse®
    • Migrating data to Managed Service for ClickHouse® using Data Transfer
    • Sharding tables
    • Using a hybrid storage
    • Fetching data from Managed Service for Apache Kafka®
    • Fetching data from RabbitMQ
    • Exchanging data with Yandex Data Processing
    • Configuring Yandex Cloud DNS for cluster access from other cloud networks
    • Analyzing Yandex Object Storage logs using Yandex DataLens
    • Configuring Managed Service for ClickHouse® for Graphite
    • Saving a data stream from Yandex Data Streams to Managed Service for ClickHouse®
    • Migrating a database from Google BigQuery
    • Delivering data from Managed Service for Apache Kafka® using Yandex Data Transfer
    • Migrating data from Yandex Direct using Yandex Cloud Functions, Yandex Object Storage, and Yandex Data Transfer
    • Loading data from Yandex Object Storage to Managed Service for ClickHouse® using Yandex Data Transfer
    • Migrating a database from Greenplum® to ClickHouse®
    • Migrating a database from MySQL® to ClickHouse® using Yandex Data Transfer
    • Asynchronously replicating data from PostgreSQL to ClickHouse®
    • Loading data from Yandex Managed Service for YDB to Managed Service for ClickHouse® using Yandex Data Transfer
    • Copying data from Managed Service for OpenSearch to Managed Service for ClickHouse® using Yandex Data Transfer
    • Ingesting data into storage systems
    • Using parameters
    • Examples of creating QL charts
    • Web analytics with funnels and cohorts calculated based on Yandex Metrica data
    • AppMetrica: direct connection
    • AppMetrica: data export, post-processing, and visualization
    • Loading data from Yandex Metrica to a ClickHouse® data mart
    • Yandex Tracker: data export and visualization
    • Retail chain's dashboard based on a ClickHouse® DB
    • Analyzing sales and locations of pizzerias based on data from the ClickHouse® database and Marketplace
    • Geocoding with the Yandex Maps API for data visualization in DataLens
    • Importing data from Object Storage, processing, and exporting to Managed Service for ClickHouse®
    • Operations with data using Query
    • Federated data queries using Query
    • Integration with an external Microsoft SQL Server database via ClickHouse® JDBC Bridge
    • Integration with an external Oracle database via ClickHouse® JDBC Bridge
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Get your cloud ready
  • Required paid resources
  • Set up your infrastructure
  • Prepare the external Oracle database
  • Query data using the JDBC table function
  • Create a table using the JDBC table engine
  • Delete the resources you created
  1. Tutorials
  2. Integration with an external Oracle database via ClickHouse® JDBC Bridge

Yandex Managed Service for ClickHouse® integration with external Oracle database via ClickHouse® JDBC Bridge

Written by
Yandex Cloud
Updated at August 14, 2025
  • Get your cloud ready
    • Required paid resources
  • Set up your infrastructure
  • Prepare the external Oracle database
  • Query data using the JDBC table function
  • Create a table using the JDBC table engine
  • Delete the resources you created

With ClickHouse® JDBC Bridge, you can:

  • Request data from an external Oracle database table using the JDBC table function.
  • Use the JDBC table engine to create tables in ClickHouse® which reference a table in an external Oracle database.

Get your cloud readyGet your cloud ready

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can navigate to the cloud page to create or select a folder for your infrastructure.

Learn more about clouds and folders here.

Required paid resourcesRequired paid resources

The solution support costs include:

  • Fee for a Managed Service for ClickHouse® cluster: using computing resources allocated to hosts (including ZooKeeper hosts) and disk space (see Managed Service for ClickHouse® pricing).
  • NAT gateway fee if public access is not enabled for cluster hosts (see Virtual Private Cloud pricing).
  • Fee for using public IP addresses if public access is enabled for cluster hosts (see Virtual Private Cloud pricing).

Set up your infrastructureSet up your infrastructure

  1. Create a security group and configure it.

    Also add a rule for outgoing traffic:

    • Port range: 0-65535
    • Protocol: TCP
    • Source: CIDR
    • CIDR blocks: 0.0.0.0/0

    This rule allows all outgoing traffic, enabling ClickHouse® JDBC Bridge to connect to external databases including Oracle.

  2. Create a Managed Service for ClickHouse® cluster.

    When creating a cluster, specify the security group prepared earlier.

    Under DBMS settings, click Settings and add the jdbcBridge option with the following parameters:

    • Host: IP address of your Oracle database installation.
    • Port: 9019.
  3. If you do not use public access, create a NAT gateway for the subnet you want to create your Managed Service for ClickHouse® cluster in.

Prepare the external Oracle databasePrepare the external Oracle database

Warning

In the command below, all entities created for the Oracle database are specified in uppercase according to the Oracle naming rules.

  1. Make sure your external Oracle database installation allows connection via ports 9019 and 1521.

  2. Connect to your external Oracle database installation and download the ojdbc8 JDBC driver into the /opt/drivers directory:

    sudo mkdir -p /opt/drivers && \
    curl -s https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/ | grep -oP '(?<=href=")[0-9][^/]+(?=/")' | sort -V | tail -n1 | xargs -I{} sudo curl -o /opt/drivers/ojdbc8-{}.jar https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/{}/ojdbc8-{}.jar
    
  3. Install Docker Engine.

  4. Run ClickHouse® JDBC Bridge:

    docker run -d --name jdbc_bridge --network host -v /opt/drivers:/app/drivers clickhouse/jdbc-bridge
    

    If your container is already running, restart it to load the new drivers to ClickHouse® JDBC Bridge:

    docker container restart jdbc_bridge
    
  5. Connect to the external Oracle database as an administrator. For example, you can use SQL Plus if you are connecting locally:

    sqlplus / as sysdba
    
  6. Switch the session to the required PDB, e.g., to PDB1:

    ALTER SESSION SET CONTAINER = PDB1;
    
  7. Create a user named JDBC_USER for connection from the Managed Service for ClickHouse® cluster:

    CREATE USER JDBC_USER IDENTIFIED BY <user_password>
    DEFAULT TABLESPACE USERS
    TEMPORARY TABLESPACE TEMP
    QUOTA UNLIMITED ON USERS;
    

    Where <user_password> is your password for the JDBC_USER user.

    Tip

    To connect to different PDBs, create a common user by adding the C## prefix to the username, e.g., C##JDBC_USER.

  8. Grant permissions required for ClickHouse® JDBC Bridge to run:

    GRANT CONNECT, RESOURCE TO JDBC_USER;
    
  9. Connect as the new user:

    CONNECT JDBC_USER/<user_password>@<Oracle_DB_host>/PDB1;
    

    Where:

    • <password>: JDBC_USER user password.
    • <Oracle_DB_host>: IP address of your Oracle database installation.
  10. Create a test table named CUSTOMERS:

    CREATE TABLE CUSTOMERS (
      NAME       VARCHAR2(100),
      EMAIL      VARCHAR2(100)
    );
    
  11. Add the test data:

    INSERT INTO CUSTOMERS (NAME, EMAIL) VALUES ('Angela Smith', 'angela@example.ru');
    INSERT INTO CUSTOMERS (NAME, EMAIL) VALUES ('Bob Johnson', 'bob@example.ru');
    INSERT INTO CUSTOMERS (NAME, EMAIL) VALUES ('Charlie Brown', 'charlie@example.ru');
    
    COMMIT;
    
  12. Make sure the data has been written:

    SELECT * FROM CUSTOMERS;
    

Query data using the JDBC table functionQuery data using the JDBC table function

  1. Connect to the Managed Service for ClickHouse® cluster.

  2. Run a query to the external Oracle database using the JDBC table function:

    SELECT * FROM jdbc('jdbc:oracle:thin:JDBC_USER/<user_password>@<Oracle_DB_host>:1521/PDB1', 'SELECT * FROM CUSTOMERS');
    

    Where:

    • <password>: JDBC_USER user password.
    • <Oracle_DB_host>: IP address of your Oracle database installation.

    If the query is successful, you will get data from the external Oracle database.

Create a table using the JDBC table engineCreate a table using the JDBC table engine

With the JDBC table engine, you can:

  • Query data via SELECT.

  • Add new values via INSERT INTO with the following limitations:

    • The table in the Managed Service for ClickHouse® cluster database must exactly mirror the structure of the table it references.
    • The only available write operation is INSERT INTO. You cannot use UPDATE, DELETE, ALTER, or other statements to modify the existing data.
    • If you add new records and do not specify their values for fields with automatic generation (DEFAULT, GENERATED BY, SYSDATE, etc.), these values will not be generated.

To use the JDBC table engine:

  1. Connect to the Managed Service for ClickHouse® cluster.

  2. Create a table with the JDBC table engine based on the table from the external Oracle database.

    CREATE TABLE oracle_customers
    ENGINE = JDBC(
      'jdbc:oracle:thin:JDBC_USER/<user_password>@<Oracle_DB_host>:1521/XEPDB1',
      'JDBC_USER',
      'CUSTOMERS'
    )
    AS SELECT *
    FROM jdbc(
      'jdbc:oracle:thin:JDBC_USER/<user_password>@<Oracle_DB_host>:1521/XEPDB1',
      'JDBC_USER',
      'SELECT * FROM CUSTOMERS'
    )
    LIMIT 0;
    

    You can also create a table specifying only some fields, but in this case you will not be able to add new values via INSERT INTO.

  3. Check the result:

    SELECT * FROM oracle_customers;
    
  4. Insert a new row:

    INSERT INTO oracle_customers (NAME, EMAIL)
      VALUES ('Alice Wonderland', 'alice@example.ru');
    

    ClickHouse® JDBC Bridge automatically opens and closes a transaction. You do not need to execute COMMIT separately.

  5. Check the result again and compare it with the previous output:

    SELECT * FROM oracle_customers;
    

    If the insertion was successful, you will see a new row in the returned output.

Delete the resources you createdDelete the resources you created

Some resources are not free of charge. To avoid paying for them, delete the resources you no longer need:

  • Delete the Managed Service for ClickHouse® cluster.
  • Delete the NAT gateway.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
Integration with an external Microsoft SQL Server database via ClickHouse® JDBC Bridge
Next
Resource relationships
© 2025 Direct Cursus Technology L.L.C.