OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Loader and Dumper

V4.1.0Community Edition

  • Document Overview
  • Product Introduction
  • Preparations
    • Prepare the environment
    • Download OBLOADER
  • User Guide (OBLOADER)
    • Overview
    • Command-line options
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • Scenarios and examples
    • FAQ
  • User Guide (OBDUMPER)
    • Overview
    • Command-line options
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • Scenarios and examples
    • FAQ

Download PDF

Document Overview Product Introduction Prepare the environment Download OBLOADER OverviewCommand-line optionsDefine control files Preprocessing functions Case expressionsPerformance tuning Scenarios and examples FAQ OverviewCommand-line optionsDefine control files Preprocessing functions Case expressions Performance tuning Scenarios and examples FAQ
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Loader and Dumper
  3. V4.1.0
iconOceanBase Loader and Dumper
V 4.1.0Community Edition
  • V 4.3.5
  • V 4.3.4.1
  • V 4.3.4
  • V 4.3.3.1
  • V 4.3.3
  • V 4.3.2.1
  • V 4.3.2
  • V 4.3.1
  • V 4.2.8
  • V 4.2.7
  • V 4.2.6
  • V 4.2.5 and earlier
Community Edition
  • V 4.2.5
  • V 4.2.4
  • V 4.1.0
  • V 4.0.0
  • V 3.0.0
Enterprise Edition
  • V 4.2.5
  • V 4.2.4

Scenarios and examples

Last Updated:2023-08-24 02:20:26  Updated
share
What is on this page
Export DDL definition files
Export CSV data files
Export SQL data files
Export CUT data files
Customize the name of an exported file
Set session-level variables
Use a control file to export data
Export data from specified table columns
Export the result set of a custom query
Export all definitions and data in limited mode

folded

share

This topic describes some common scenarios that OBDUMPER supports and provides the corresponding use cases.

The following table provides information about the database used in the examples.

Database configuration item Example
Cluster name cluster_a
IP address of the OceanBase DataBase Proxy (ODP) host 10.0.0.0
ODP port number 2883
Tenant name of the cluster mysql
Password of the root/proxyro user under the SYS tenant ******
User account (with read/write privileges) under the business tenant test
Password of the user under the business tenant ******
Schema name USERA

Export DDL definition files

Scenario description : Export the DDL statements of all supported objects in the USERA schema to the /output directory.

Sample code :

[admin@localhost]> ./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --ddl --all -f /output

Export CSV data files

File format definition : A CSV data file has the .csv file name extension. CSV is a file format that uses commas (,) as the separator. CSV data files store tabular data in the form of plain text. You can open them by using a text editor or Excel.

Scenario description : Export the data of all supported objects in the USERA schema to the /output directory in the CSV format.

Sample code :

[admin@localhost]> ./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --csv --all -f /output 

Export SQL data files

File format definition : An SQL data file has the .sql file name extension. SQL is a file format compiled in the SQL language. SQL data files are mainly used to store and retrieve data and update and manage relational database systems. You can open these files by using a text editor or SQL software.

Scenario description : Export the data of all supported objects in the USERA schema to the /output directory in the SQL format.

Sample code :

[admin@localhost]> ./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --sql --all -f /output

Export CUT data files

File format definition : A CUT data file has the .dat file name extension. CUT is a file format that uses a character string as the separator. Data in a CUT file is separated by the corresponding character string. You can open a CUT file by using a text editor or Excel.

Scenario description : Export the data of the table named "table" in the USERA schema to the /output directory in the CUT format, with |@| being the separator and |@| appended to the end of each row.

Sample code :

./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --table'table' -f /output --cut --column-splitter '|@|' --trail-delimtier

Customize the name of an exported file

Scenario description: Export the data of the table named "table" in the USERA schema to the /output directory in the CUT format, with the exported file being named as "filetest".

Sample code :

./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --cut --column-splitter '|@|' --table 'table' --file-name 'filetest.txt' --public-cloud  -f /output

Set session-level variables

# This variable is used to initialize the session.
# The default value is 5 minutes.
ob.query.timeout.for.init.session=5

# This variable is used to initialize the session.
# The default value is 5 minutes.
ob.trx.timeout.for.init.session=5

# This variable is used to query metadata, such as
#   to query the database;
#   to query the row key, primary key, and macro range;
#   to query the primary key;
#   to query the unique key;
#   to query load status;
# The default value is 5 minutes.
ob.query.timeout.for.query.metadata=5

# This variable is used to dump records for CSV, CUT, and SQL.
# The default value is 24 hours.
ob.query.timeout.for.dump.record=24

# This variable is used to dump records for query-sql.
# The default value is 5 hours.
ob.query.timeout.for.dump.custom=5

# This variable is used to execute DDL statements, such as statements for loading the schema and truncating the table.
# The default value is 1 minute.
ob.query.timeout.for.exec.ddl=1

# This variable is used to execute DML statements, such as the statement for deleting the table.
# The default value is 1 hour.
ob.query.timeout.for.exec.dml=1

# This variable is used to dump records for CSV, CUT, and SQL.
# The default value is 24 hours.
ob.trx.timeout.for.dump.record=24

# This variable is used to dump records for query-sql.
# The default value is 5 hours.
ob.trx.timeout.for.dump.custom=5

# This variable is used to dump records for CSV, CUT, and SQL.
# The default value is 24 hours.
ob.net.read.timeout.for.dump.record=24

# This variable is used to dump records for query-sql.
# The default value is 5 hours.
ob.net.read.timeout.for.dump.custom=5

# This variable is used to dump records for CSV, CUT, and SQL.
# The default value is 24 hours.
ob.net.write.timeout.for.dump.record=24

# This variable is used to dump records for query-sql.
# The default value is 5 hours.
ob.net.write.timeout.for.dump.custom=5

# This variable is used to set the session variable ob_proxy_route_policy.
# The default value is follower_first.
ob.proxy.route.policy=follower_first

Use a control file to export data

Scenario description : Export the data of the table named "table" in the USERA schema to the /output directory in the CUT format, with '|@|' being the separator. The path of the control file is /output.

Sample code :

./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --table'table' -f /output --cut --column-splitter '|@|' --ctl-path /output

The following code shows a sample rule defined in the control file:

lang=java
(
  c1 "lpadb(c1,20,'x')",
  c2 "rpadb(c2,20,'x')"
);

Export data from specified table columns

Scenario description: Export the data of the table named "table" in the USERA schema to the /output directory in the CUT format, with the data in columns specified in --exclude-column-names being excluded from the export.

Sample code :

./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA -f /output --table'table' --cut --column-splitter '|@|' --exclude-column-names 'deptno' --public-cloud 

Export the result set of a custom query

File format definition : An SQL data file has the .sql file name extension. SQL is a file format compiled in the SQL language. SQL data files are mainly used to store and retrieve data and update and manage relational database systems. You can open these files by using a text editor or SQL software.

Scenario description: Export the returned result set of the SQL statement defined in the --query-sql option in the CUT format.

Sample code :

-- Export of single-table queries
./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --cut --column-splitter '|@|' --query-sql 'select deptno,dname from dept where deptno<3000' --public-cloud

-- Export of a multi-table query
./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --cut --column-splitter '|@|' --query-sql 'select * from dept,STUDENT where 1=1;' --public-cloud

Export all definitions and data in limited mode

Scenario description : Export the definitions and data of all tables and views in the USERA schema to the /output directory in limited mode.

Sample code :

[admin@localhost]> ./obdumper -h 10.0.0.0 -P 2883 -u test -p ****** --sys-password ****** -c cluster_a -t mysql -D USERA --ddl --sql --public-cloud  --all -f  /output

Previous topic

Performance tuning
Last

Next topic

FAQ
Next
What is on this page
Export DDL definition files
Export CSV data files
Export SQL data files
Export CUT data files
Customize the name of an exported file
Set session-level variables
Use a control file to export data
Export data from specified table columns
Export the result set of a custom query
Export all definitions and data in limited mode