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

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase 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 ServiceOceanBase DataPilotOceanBase OAgent

Connectors and Middleware

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

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase 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 ServiceOceanBase DataPilotOceanBase OAgent
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Loader and Dumper

V5.0.0
  • Document Overview
  • Introduction
  • Technical Mechanism
  • Preparations
    • Prepare the environment
    • Prepare data
    • Download OBLOADER & OBDUMPER
    • Startup parameters
  • User Guide (OBLOADER)
    • Quick start
    • Command-line options
    • Multi-database import
    • Direct load
    • Data processing
      • Define a control file
      • Preprocessing functions
      • Case expressions
    • Use cases of command-line options
    • Performance tuning
    • Error handling
    • FAQ
  • User Guide (OBDUMPER)
    • Quick start
    • Command-line options
    • Multi-database export
    • Data processing
      • Define a control file
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • FAQ
  • Control file guide
  • Security Features
  • Connection configuration
  • Self-service Troubleshooting
  • Release Note
    • Release Note
      • 5.x
        • OBLOADER & OBDUMPER V5.0.0
      • 4.x
        • OBLOADER & OBDUMPER V4.3.7
        • OBLOADER & OBDUMPER V4.3.6
        • OBLOADER & OBDUMPER V4.3.5
        • OBLOADER & OBDUMPER V4.3.4.1
        • OBLOADER & OBDUMPER V4.3.4
        • OBLOADER & OBDUMPER V4.3.3.1
        • OBLOADER & OBDUMPER V4.3.3
        • OBLOADER & OBDUMPER V4.3.2.1
        • OBLOADER & OBDUMPER V4.3.2
        • OBLOADER & OBDUMPER V4.3.1.1
        • OBLOADER & OBDUMPER V4.3.1
        • OBLOADER & OBDUMPER V4.3.0
        • OBLOADER & OBDUMPER V4.2.8.2
        • OBLOADER & OBDUMPER V4.2.8.1
        • OBLOADER & OBDUMPER V4.2.8
        • OBLOADER & OBDUMPER V4.2.7
        • OBLOADER & OBDUMPER V4.2.6
        • OBLOADER & OBDUMPER V4.2.5
        • OBLOADER & OBDUMPER V4.2.4
        • OBLOADER & OBDUMPER V4.2.1
        • OBLOADER & OBDUMPER V4.2.0
        • OBLOADER & OBDUMPER V4.1.0
        • OBLOADER & OBDUMPER V4.0.0
      • 3.x
        • OBLOADER & OBDUMPER V3.3.2
        • OBLOADER \& OBDUMPER V3.1.0
        • OBLOADER \& OBDUMPER V3.0.0
    • Versioning rules

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Loader and Dumper
  3. V5.0.0

Multi-database export

Last Updated:2026-11-10 11:21:27

Implementation
Single-database mode
Multi-database mode
Database-level DDL files
Examples
Scenario 1: Single-database export (unchanged)
Scenario 2: Multi-database export (export multiple databases in one task)
Scenario 3: Tenant-level export (indirectly achieving full-tenant export)

OBDUMPER V4.3.5 and later versions support exporting database objects to multiple databases or schemas in a single export task, while maintaining the original single-database export behavior.

Implementation

Single-database mode

If the object parameters such as --table and --view do not contain specific databases or schemas (i.e., no periods are present), it is considered a single-database export. The default database specified by -D is used.

Multi-database mode

If any object parameter value contains specific databases or schemas (i.e., periods are present), it enters multi-database export mode. For example, test.table1, test1.*, *.*, test[0-9].tbl, test*.table, or test?.tbl.

In multi-database mode, a single multi-database export command is split into multiple single-database export subtasks. The details are as follows:

  • The object parameters such as --table and --view are parsed, and <schema.object> is distributed to corresponding database/schema subtasks, specifying the export scope.

  • If an object does not contain specific databases or schemas (e.g., --table 'db1.tbl1, tbl2' -D 'db2'), the default database specified by -D is used, while other options remain unchanged.

In multi-database mode, exporting objects to different databases/schemas can be understood as executing multiple single-database export tasks. Here is an example:

obdumper -D test --table 'test1.tbl1,test2.tbl2' ...
-> obdumper -D test1 --table tbl1 ...
-> obdumper -D test2 --table tbl2 ...

obdumper -D test --table 'tbl1,test2.tbl2' ...
-> obdumper -D test --table tbl1 ...
-> obdumper -D test2 --table tbl2 ...

The default export directory structure includes an additional directory level for databases or schemas. The following example shows definition files for tables and views, along with table data files:

./outputs/
└── data
    ├── test
    │   ├── TABLE
    │   │   ├── sample_tbl1.csv
    │   │   ├── sample_tbl1-schema.sql
    │   │   ├── sample_tbl2.csv
    │   │   └── sample_tbl2-schema.sql
    │   └── VIEW
    │       ├── sample_tbl1_view-schema.sql
    │       └── sample_tbl2_view-schema.sql
    └── test1
        ├── TABLE
        │   ├── sample_tbl1.csv
        │   ├── sample_tbl1-schema.sql
        │   ├── sample_tbl2.csv
        │   └── sample_tbl2-schema.sql
        └── VIEW
            ├── sample_tbl1_view-schema.sql
            └── sample_tbl2_view-schema.sql

7 directories, 12 files

Notice

If the database or schema name contains [, {, or other wildcard control characters, you need to escape these characters to successfully export.

Database-level DDL files

In OBDUMPER V5.0.0, exporting with --ddl --all without --no-nested-dir generates data/<database_name>/<database_name>-schema.sql under the directory specified by -f. For a multi-database export, a separate file is generated for each selected database or schema. In Oracle mode, SYS access is also required. If you specify --no-sys or --public-cloud, user definitions for the schema are skipped.

For example, an export with -f /dump -D db1 --ddl --all generates the following database-level DDL file (other files are omitted):

/dump/
└── data
    └── db1
        └── db1-schema.sql

The file contents depend on the compatibility mode:

Compatibility mode
File contents
MySQL A statement to create the database, including its name, default character set, and collation.
Oracle A statement to create the user for the schema, along with the retrieved password hash and privilege grant statements.

Definitions of objects such as tables and views are stored separately in their respective object directories. OBLOADER reads these SQL files to create databases or schemas and restore objects. The database-level DDL files are used in full database restore workflows with --create-database / --create-schema or --remap-database / --remap-schema.

OBDUMPER V5.0.0 no longer generates database.json. Databases or schemas and their objects are restored from these SQL files instead; the SQL files are not renamed copies of the old JSON file. The .MANIFEST.bin file generated during CSV export allows OBLOADER to reuse format settings such as delimiters, line separators, null values, and headers. It is neither a database-level DDL file nor a replacement for database.json.

For more information about database-level DDL export commands and restrictions, see Command-line options.

Examples

Scenario 1: Single-database export (unchanged)

Export the test database to /outputs.

./obdumper -h xxx.xxx.xxx.xxx -P 2883 -u test@mysql#cluster_a -p ****** -D test --csv --table '*' -f /outputs

Scenario 2: Multi-database export (export multiple databases in one task)

  • Method 1

    ./obdumper -h xxx.xxx.xxx.xxx -P 2883 -u test@mysql#cluster_a -p ****** --csv --table 'test[1-3].*' -f /outputs
    
  • Method 2

    ./obdumper -h xxx.xxx.xxx.xxx -P 2883 -u test@mysql#cluster_a -p ****** --csv --table 'test1.*, test2.*, test3.*' -f /outputs
    
  • Method 3

    ./obdumper -h xxx.xxx.xxx.xxx -P 2883 -u test@mysql#cluster_a -p ****** --csv --table 'test1.*' --table 'test2.*' --table 'test3.*' -f /outputs
    

Scenario 3: Tenant-level export (indirectly achieving full-tenant export)

Export all objects from all databases, including definitions and data.

./obdumper -h xxx.xxx.xxx.xxx -P 2883 -u test@mysql#cluster_a -p ****** --table '*.*' --ddl --csv --all -f /outputs

Previous topic

Command-line options
Last

Next topic

Define a control file
Next
on this page
Implementation
Single-database mode
Multi-database mode
Database-level DDL files
Examples
Scenario 1: Single-database export (unchanged)
Scenario 2: Multi-database export (export multiple databases in one task)
Scenario 3: Tenant-level export (indirectly achieving full-tenant export)