OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Database

  • Overview of the ecosystem
  • ORM frameworks
    • Java
      • Spring Boot
      • Spring Batch
      • Use Spring JDBC to connect to OceanBase Database
      • Spring Data JPA
      • Hibernate
      • MyBatis
      • jOOQ
    • Python
      • Use SQLAlchemy to connect to OceanBase Database
      • Connect to OceanBase Database by using peewee
      • Use Tortoise ORM to connect to OceanBase Database
    • Go
      • Connect to OceanBase Database by using GORM
      • beego ORM
    • Rust
      • SeaORM Connection to OceanBase Database
      • Diesel Connection to OceanBase Database
    • Ruby
      • Active Record
      • Sequel Connection to OceanBase Database
      • Connect to OceanBase Database by using Ruby on Rails
    • Node.js
      • Sequelize
      • TypeORM
      • Prisma
      • Drizzle
    • C#
      • Dapper
      • SqlSugar
      • FreeSQL
    • PHP
      • Connect to OceanBase Database by using the Yii 2.0 ORM
      • Connect to OceanBase Database by using Laravel Eloquent ORM
      • CakePHP
  • Database version management
    • Liquibase
    • Flyway
  • Data integration
    • Flink
      • Apache Flink
      • Flink DirectLoad
      • Flink Connector OceanBase
    • dbt
    • SeaTunnel
    • Maxwell
    • Debezium
    • Spark Catalog
    • NiFi
    • Qlik Replicate
    • RisingWave CDC
    • Flume
    • Migrate data from SQL Server to OceanBase Database by using MySQL Workbench
  • SQL development
    • WebLogic
    • DBeaver
    • Navicat
    • DataGrip
    • TablePlus
    • DMS
  • Orchestration and scheduling
    • Airflow
    • PowerJob
    • DolphinScheduler
    • Linkis
  • Visualization tools
    • Superset
    • Excel
    • Power BI
    • Quick BI
    • Tableau
    • GuanData
    • vividime
    • DataV
    • Metabase
    • Redash
    • FineReport
  • Database management
    • NineData
    • Bytebase
    • DataHub
    • Zabbix
  • AI
    • OpenAI
    • Qwen
    • LangChain
    • LlamaIndex
    • Dify
    • n8n
    • Trae
    • SpringAI
    • Cline
    • Cursor
    • Continue
    • MCP Toolbox
    • CamelAI
    • Firecrawl
    • Hugging Face
    • Ollama
    • Google Gemini
    • Cloudflare Workers AI
    • DB GPT
    • Jina AI
    • Augment Code
    • Claude Code
    • Kiro
    • GPT4All
  • Application
    • Ghost
    • Jira
    • Seata
    • SAP Crystal Reports
  • Middleware
    • Apache Pulsar

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Database
  3. master

Read and synchronize data in OceanBase Database by using SeaTunnel

Last Updated:2026-09-04 07:40:45

Prerequisites

SeaTunnel is a distributed, highly scalable data integration platform for transferring data between various data storage systems. It provides easy-to-configure data flow task plugins, allowing you to define processes for data processing and transformation. For more information, visit the GitHub page about SeaTunnel.

Prerequisites

Before data synchronization, make sure that the following conditions are met:

  • You have downloaded SeaTunnel.
  • You have installed Java 1.8 or later.
  • You have downloaded the MySQL driver to the lib directory.
  • You have installed oblogproxy.
Read data by using SeaTunnel
Synchronize data by using SeaTunnel

This section describes how to execute SQL queries in a MySQL tenant of OceanBase Database by using MySQL Change Data Capture (CDC) Source Connector for SeaTunnel. connector-cdc-mysql is a plug-in of SeaTunnel for real-time capture and streaming of change data in MySQL databases.

Procedure

Follow the steps below to synchronize data between MySQL tenants of OceanBase Database:

  1. Create a SeaTunnel user.

     CREATE USER 'Username'@'%' IDENTIFIED BY 'Password';
     GRANT SELECT ON *.* TO 'Username';
    
  2. Configure the config/plugin_config file.

    Specify connector-cdc-mysql and execute the sh bin/install-plugin.sh 2.3.3 command.

  3. Configure SeaTunnel.

    Modify the configuration file config/v2.streaming.conf.template as follows:

    source {
    # This is a example source plugin **only for test and demonstrate the feature source plugin**
    MySQL-CDC {
    result_table_name = "fake"
    parallelism = 1
    server-id = 5656
    username = "Username"
    password = "Password"
    table-names = ["seatunnel.full_types"]
    base-url = "jdbc:mysql://xx.xxx.x.xx:2881/seatunnel"
    }
    
    # If you would like to get more information about how to configure SeaTunnel and see full list of source plugins,
    # please go to https://seatunnel.apache.org/docs/category/source-v2
    }
    
  4. Start SeaTunnel.

    Run the following command to start SeaTunnel:

    ./bin/seatunnel.sh --config ./config/v2.streaming.conf.template -e local
    

This section describes how to synchronize data by using JDBC OceanBase Source Connector and JDBC OceanBase Sink Connector for SeaTunnel. JDBC OceanBase Source Connector supports full read and write on data from a single table of OceanBase Database. For more information, see JDBC OceanBase Source Connector. JDBC OceanBase Sink Connector supports full read and write on data from multiple tables of OceanBase Database. For more information, see JDBC OceanBase Sink Connector.

Procedure

Follow the steps below to synchronize data between MySQL tenants of OceanBase Database:

  1. Create a SeaTunnel user.

     CREATE USER 'Username'@'%' IDENTIFIED BY 'Password';
     GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'Username';
    
  2. Configure the config/plugin_config file.

  3. Download the OceanBase Connector/J driver to the lib directory. For more information, see OceanBase Client.

  4. Configure SeaTunnel.

    Modify the configuration file config/ob_to_ob as follows:

    env {
    parallelism = 1
    job.mode = "BATCH"
    }
    
    source {
    # This is a example source plugin **only for test and demonstrate the feature source plugin**
    Jdbc {
        driver = com.oceanbase.jdbc.Driver
        url = "jdbc:oceanbase://e2e_oceanbase_mysql:2881/seatunnel?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&serverTimezone=UTC"
        user = "Username"
        password = "Password"
        query = "SELECT c_bit_1, c_bit_8 FROM source"
        compatible_mode = "mysql"
    }
    
    # If you would like to get more information about how to configure seatunnel and see full list of source plugins,
    # please go to https://seatunnel.apache.org/docs/connector-v2/source/FakeSource
    }
    
    sink {
    Jdbc {
        driver = com.oceanbase.jdbc.Driver
        url = "jdbc:oceanbase://e2e_oceanbase_mysql:2881/seatunnel?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&serverTimezone=UTC"
        user = "Username"
        password = "Password"
        query = "insert into sink(c_bit_1, c_bit_8) values (?, ?);"
        compatible_mode = "mysql"
    }
    # If you would like to get more information about how to configure seatunnel and see full list of sink plugins,
    # please go to https://seatunnel.apache.org/docs/connector-v2/sink
    }
    
  5. Start SeaTunnel.

    Run the following command to start SeaTunnel:

    ./bin/seatunnel.sh --config ./config/ob_to_ob -e local
    

Notice

OceanBase Database does not support the SET datatype. If you use the SET datatype, the following error message may be returned:
Caused by: org.apache.seatunnel.api.table.catalog.DataTypeConvertException: ErrorCode:[COMMON-07], ErrorDescription:[Unsupported data type] - Convert type: SET to SeaTunnel data type error.

For more information, see SeaTunnel MySQL CDC documentation.

Previous topic

dbt
Last

Next topic

Maxwell
Next
on this page
Prerequisites