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.3.3

  • Document Overview
  • Introduction
  • Technical mechanism
  • Preparations
    • Prepare the environment
    • Prepare data
    • Download OBLOADER & OBDUMPER
  • User Guide (OBLOADER)
    • Quick start
    • Command-line options
    • Direct load
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Use cases of command-line options
    • Performance tuning
    • Error handling
    • FAQ
  • User Guide (OBDUMPER)
    • Quick start
    • Command-line options
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • FAQ
  • Security features
  • Connection settings
  • Self-service troubleshooting
  • Release Note
    • Release Note
      • 4.x
        • 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.6
        • OBLOADER & OBDUMPER V4.2.7
        • OBLOADER & OBDUMPER V4.2.5
        • OBLOADER & OBDUMPER V4.2.4
        • OBLOADER & OBDUMPER V4.2.1
        • OBLOADER \& OBDUMPER V4.1.0
        • OBLOADER \& OBDUMPER V4.0.0
      • 3.x
        • OBLOADER \& OBDUMPER V3.1.0
        • OBLOADER \& OBDUMPER V3.0.0
    • Version rules

Download PDF

Document Overview Introduction Technical mechanism Prepare the environment Prepare data Download OBLOADER & OBDUMPER Quick start Command-line options Direct load Define control files Preprocessing functionsCase expressions Use cases of command-line options Performance tuning Error handling FAQ Quick start Command-line options Define control files Preprocessing functionsCase expressions Performance tuning FAQ Security features Connection settings Self-service troubleshooting Version rules
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.3.3
iconOceanBase Loader and Dumper
V 4.3.3
  • 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

Command-line options

Last Updated:2025-10-27 09:35:21  Updated
share
What is on this page
Overview
Option styles
Option categories
Required options
Basic options
Connection options
Feature options
Other options
Advanced options
Feature options
Performance options
Other options
Quick reference table of options

folded

share

OBDUMPER allows you to specify the information required for export by using command-line options. For more information about the options and their scenarios and examples, see the Quick reference table of options section in this topic and the Quick start topic.

Overview

Option styles

OBDUMPER supports command-line options in Unix and GNU styles.

  • Unix style: An option is prefixed with a hyphen and each option is a single character, such as ps -e. In this style, you can omit the space between an option and its value, such as -p******.

  • GNU style: An option is prefixed with double hyphens and each option is a single character or a string, such as ps --version. An option and its value must be separated with a space, such as --table 'test'.

Option categories

Command-line options in OBDUMPER are classified into basic options and advanced options.

  • Basic options are general options of OBDUMPER, including connection options (such as the database connection method), feature options (such as the file format, database object type, and storage path), and other options.

  • Advanced options are feature options (such as the timestamp format, allowlist- and blocklist-based table/column filtering settings, and error handling method) and performance options.

Required options

When you use OBDUMPER to export data, you must specify at least the connection options, format option, database object type option, and storage path option.

Here is a sample command:

$./obdumper -h xx.x.x.x -P 2883 -u test@mysql#cluster_a -p ****** -D USERA --csv --table '*' -f /output

In this example, -h, -P, -u, -p, and -D are connection options, the --csv option specifies the file format, the --table option specifies the database object type, and the -f option specifies the storage path.

Basic options

Connection options

OBDUMPER can read data from and write data to OceanBase Database only after it is connected to the database. You can connect to an OceanBase database by specifying the following options.

Export types

Export type Relevant command-line option
OceanBase Database
  • -h host_name, --host= host_name
    The host IP address for connecting to a physical OceanBase Database node.

    Note

    In OBDUMPER V4.2.6 and later, you can enter multiple IP addresses or domain names separated with commas (,).

  • -P port_num, --port= port_num
    The host port for connecting to a physical OceanBase Database node.

    Note

    • In OBDUMPER V4.2.6 and later, you can enter one or more port numbers separated with commas (,).
    • If you enter only one port number, all hosts share the same port number.
  • -c cluster_name, --cluster= cluster_name
    The OceanBase cluster to connect to. If this option is not specified, a physical node of the database is connected. The -h and -P options specify the host IP address and port number of the physical node. If this option is specified, OceanBase Database Proxy (ODP) is connected. The -h and -P options specify the host IP address and port number of ODP.
  • -u,--user
    The username, tenant name, and cluster name for connecting to OceanBase Database. The value is in the format of <user>@<tenant>#<cluster>, for example, -u user@tenant#cluster.
    • If you specify an incorrect username, OBDUMPER cannot connect to OceanBase Database.
    • If no cluster name is specified, a physical node of the database is connected. The -h and -P options specify the host IP address and port number of the physical node. If a cluster name is specified, ODP is connected. The -h and -P options specify the host IP address and port number of ODP.
  • -D database_name, --database= database_name
    The name of the database from which OBDUMPER exports database object definitions and table data.
  • -p 'password', --password='password'
    The user password for connecting to OceanBase Database. If no password is set for the current database account, you do not need to specify this option. To specify this option on the CLI, you must enclose the value in single quotation marks (' '), such as -p'******'.

    Note

    If you are using a Windows OS, enclose the value in double quotation marks (" "). This rule also applies to string values of other options.

  • --sys-user sys_username
    The username of a user with required privileges in the sys tenant, such as root or proxyro. OBDUMPER requires such a user to query metadata in system tables. The default value is root. You do not need to specify this option in OceanBase Database V4.0.0 and later.
  • --sys-password 'sys_password'
    The password of a user with required privileges in the sys tenant. This option is used with the --sys-user option. By default, the password of the root user in the sys tenant is left empty. When you specify this option on the CLI, enclose the value in single quotation marks (' '), for example, --sys-password '******'. You do not need to specify this option in OceanBase Database V4.0.0 and later.

    Note

    If this option is not specified, OBDUMPER cannot query metadata in system tables, and the export features and performance may be greatly affected.

  • --no-sys
    Exports database object definitions or table data from an OceanBase cluster to a file when you cannot provide the password of the sys tenant. Unlike the --public-cloud option, the --no-sys option requires you to specify the tenant name option (-u <user>@<tenant>) on the CLI, and also add the cluster option (-u <user>@<tenant>#<cluster>) to connect to ODP. In OceanBase Database V4.0.0 and earlier, if you do not specify the --public-cloud or --no-sys option, the --sys-user and --sys-password options must be specified for OBDUMPER.
ApsaraDB for OceanBase --public-cloud
Exports database object definitions or table data from an ApsaraDB for OceanBase cluster to a file. If you specify this option on the CLI, you do not need to specify the tenant name and cluster name options (-u <user>@<tenant>#<cluster>). OBDUMPER enables the --no-sys option by default. For more information about the --no-sys option, see the corresponding option description.
ODP (sharding)
  • -h host_name, --host= host_name
    The host IP address for connecting to ODP.
  • -P port_num, --port= port_num
    The host port for connecting to ODP.
  • -c cluster_name, --cluster= cluster_name
    The OceanBase cluster to connect to.
  • --logical-database
    Exports data by using ODP (sharding). If you specify the --logical-database option on the CLI, the definition of a random physical database shard is exported and the shard cannot be directly imported into the database. You must manually convert the exported physical shard to a logical one before you import it into the database for business use.

    Note

    If you specify the --logical-database option on the CLI, the definition of a random physical database shard is exported and the shard cannot be directly imported into the database. You must manually convert the exported physical shard to a logical one before you import it into the database for business use.

Feature options

File formats

Format (option) Relevant option Scenario
--csv
Exports data files in the CSV format.
  • --skip-header
    Take the value of BOOLEAN, indicating whether to ignore the header row, namely, the first row of field names, in the CSV file.
  • --column-delimiter 'column_delimiter_char'
    The string delimiter.
  • --line-separator 'line_separator_string'
    The line separator.
  • --escape-character 'escape_char'
    The escape character.
  • --column-separator 'column_separator_char'
    The column separator.
  • --with-trim
    Deletes the space characters on the left and right sides of the data.
  • --character-set 'character_set_string'
    The character set for creating a database connection.
  • --null-string 'null_replacer_string'
    Replaces NULL with the specified character.
  • --empty-string 'empty_replacer_string'
    Replaces an empty string (' ') with the specified character.
  • --file-encoding 'encode_name'
    The character set used during file export, which is not the database character set.
  • --flashback-scn 'scn_number'
    Exports data after an SCN transaction point.
This option applies to almost all business scenarios.
--cut
Exports data files in the CUT format.
  • --column-splitter 'split_string'
    The column separator.
  • --trail-delimiter
    Truncates the last column separator in a line.
  • --line-separator 'line_separator_string'
    The line separator.
  • --with-trim
    Deletes the space characters on the left and right sides of the data.
  • --character-set 'character_set_string'
    The character set for creating a database connection.
  • --null-string 'null_replacer_string'
    Replaces NULL with the specified character.
  • --escape-character 'escape_char'
    The escape character.
  • --empty-string 'empty_replacer_string'
    Replaces an empty string (' ') with the specified character.
  • --file-encoding 'encode_name'
    The character set used during file export, which is not the database character set.
  • --flashback-scn 'scn_number'
    Exports data after an SCN transaction point.
This option applies to almost all business scenarios. Generally, we recommend that you export data in the CSV format.
POS(--cut)
The POS format, namely, the fixed-length format. Unlike the CSV format, the POS format stores data in fixed-length fields. The length of each field is predefined.

Notice

The command-line option is still CUT. When you use this option, you must set the column separator to an empty string by using the --column-splitter option and define a control file to set the column length.

  • --column-splitter 'split_string'
    The column separator.
  • --line-separator 'line_separator_string'
    The line separator.
  • --escape-character 'escape_char'
    The escape character.
  • --file-encoding 'encode_name'
    The character set used during file export, which is not the database character set.
  • --trail-delimiter
    Truncates the last column separator in a line.
This option is used for interaction with data extraction, transformation, and loading (ETL) platforms that support only a fixed-length format.
--sql
Exports data files in the SQL format.
  • --line-separator 'line_separator_string'
    The line separator.
  • --character-set 'character_set_string'
    The character set for creating a database connection.
  • --null-string 'null_replacer_string'
    Replaces NULL with the specified character.
  • --file-encoding 'encode_name'
    The character set used during file export, which is not the database character set.
  • --flashback-scn 'scn_number'
    Exports data after an SCN transaction point.
This option applies to almost all business scenarios.
--par
Exports data files in the Parquet format.
  • --character-set 'character_set_string'
    The character set for creating a database connection.
  • --file-encoding 'encode_name'
    The character set used during file export, which is not the database character set.
  • --flashback-scn 'scn_number'
    Exports data after an SCN transaction point.
This option applies to backup scenarios where you need to achieve a balance between data compression and export performance.
The import/export performance is similar to that of the CSV format. However, the compression ratio is high.

Note

In a test environment, the expected compression ratio is about 20%. The distribution characteristics of data significantly affect the compression ratio. For example, data with a high repetition rate has a higher compression ratio. We recommend that you enable parallel write to achieve optimal performance.

--orc
Exports data files in the ORC format.
  • --character-set 'character_set_string'
    The character set for creating a database connection.
  • --file-encoding 'encode_name'
    The character set used during file export, which is not the database character set.
  • --flashback-scn 'scn_number'
    Exports data after an SCN transaction point.
This option applies to scenarios that require extreme data compression.
The import/export performance is a little poorer than that of the CSV format. Due to known issues of the third-party component Apache ORCWriter, a large amount of memory space is required during export. The compression ratio is higher than that of the Parquet format but is still subject to the data distribution. We recommend that you enable parallel write to achieve optimal performance.
--ddl
Exports DDL files.
  • --character-set 'character_set_string'
    The character set for creating a database connection.
  • --file-encoding 'encode_name'
    The character set used during file export, which is not the database character set.
  • --drop-object
    Inserts a DROP statement before the database object creation statement for the export of a DDL file.
  • --flashback-scn 'scn_number'
    Exports data after an SCN transaction point.
This option applies to logical backup.
--avro
Exports data files in the Avro format.
  • --character-set 'character_set_string'
    The character set for creating a database connection.
  • --file-encoding 'encode_name'
    The character set used during file export, which is not the database character set.
  • --flashback-scn 'scn_number'
    Exports data after an SCN transaction point.
Generally, this option applies to the big data field for scenarios such as offline migration of analytical processing (AP) business data.

Note

For more information about the command-line options, see the Quick reference table of options section in this topic.

Compress data for export

OBDUMPER V4.3.0 and later allow you to compress CSV, CUT, POS, and SQL files for export. You can specify related configurations by using the following command-line options:

  • --compress

    Specifies whether to compress data during export. It is a Boolean value.

  • --compression-algo

    The compression algorithm. The value is a string. Valid values are zstd, zlib, gzip, and snappy. The default value is zstd.

  • --compression-level

    The compression level for the specified compression algorithm. The value is an integer. Compression levels supported for different compression algorithms are as follows:

    • zstd: 1 to 22. The default value is 3.

    • zlib: -1 to 9. The default value is -1.

    • gzip and snappy: You cannot specify a compression level for this compression algorithm.

Database object types

  • --all

    Exports all database object definitions and table data, including all database object types specified by the --trigger and --view options. Observe the limitations on specific database object types.

    • When this option is used with the --ddl option, all database object definitions are exported. Database object types specified by the --trigger option are supported only in the Oracle compatible mode of OceanBase Database. In the MySQL compatible mode of OceanBase Database, DDL operations on triggers cannot be exported even if you specify both the --all and --ddl options.

    • When this option is used with the --csv, --sql, or --cut option, data in all tables is exported in the specified format. To export all database object definitions and table data, you can specify the --all and --ddl options along with a data format option.

    Notice

    The --all option is mutually exclusive with any database object options. It cannot be specified together with other database object options. If both the --all option and a database object option are specified, the --all option will be executed first.

  • --table-group 'table_group_name [,table_group_name...]' | --table-group '*'

    Exports table group definitions. This option is similar to the --table option, except that this option does not support data export.

  • --table 'table_name [,table_name...]' | --table '*'

    Exports table definitions or table data. When this option is used with the --ddl option, only table definitions are exported. When this option is used with any data format option, only table data is exported. To specify multiple tables, separate the table names with commas (,). By default, in the Oracle compatible mode of OceanBase Database, the table names are in uppercase, and in the MySQL compatible mode of OceanBase Database, the table names are in lowercase. For example, in the Oracle compatible mode of OceanBase Database, both --table 'test' and --table 'TEST' indicate the table named TEST, and in the MySQL compatible mode of OceanBase Database, both --table 'test' and --table 'TEST' indicate the table named test. To enable case sensitivity, enclose a table name in brackets ([]). For example, --table '[test]' indicates the table named test, while --table '[TEST]' indicates the table named TEST. If the table name is specified as an asterisk, all table definitions or table data are exported.

    Note

    • OBDUMPER does not support the export of data from internal tables or views of OceanBase Database.
    • OBDUMPER V4.1.0 and later allow you to export temporary table definitions in the Oracle compatible mode of OceanBase Database.
  • --view 'view_name [, view_name...]' | --view '* '

    Exports view definitions. This option is similar to the --table option, except that this option does not support data export.

  • --trigger 'trigger_name [, trigger_name...]' | --trigger '*'

    Exports trigger definitions. This option is similar to the --table option, except that this option does not support data export. This option is supported only in the Oracle compatible mode of OceanBase Database.

  • --sequence 'sequence_name [, sequence_name...]' | --sequence '*'

    Exports sequence definitions. This option is similar to the --table option, except that this option does not support data export.

    Notice

    OBDUMPER V4.0.0 and earlier apply only to the the Oracle compatible mode of OceanBase Database. OBDUMPER V4.1.0 and later apply to both the MySQL compatible and the Oracle compatible modes of OceanBase Database.

    Valid values of the --sequence-policy option are restart and preserve. The default value is preserve.

    • If the default value preserve is used when you export a sequence, the start value is set to the current value of the sequence.

    • If you set the value to restart when you export a sequence, the original definition of the start value is used.

  • --synonym 'synonym_name [, synonym_name...]' | --synonym '*'

    Exports synonym definitions. This option is similar to the --table option, except that this option does not support data export. This option is supported only in the Oracle compatible mode of OceanBase Database.

  • --type 'type_name [, type_name...]' | --type '*'

    Exports type definitions. This option is similar to the --table option, except that this option does not support data export. This option is supported only in the Oracle compatible mode of OceanBase Database.

    Note

    You can export type definitions only in Oracle-compatible tenants of OceanBase Database V2.2.77 and later.

  • --type-body 'typebody_name [, typebody_name...]' | --type-body '* '

    Exports type body definitions. This option is similar to the --table option, except that this option does not support data export. This option is supported only in the Oracle compatible mode of OceanBase Database.

    Note

    This option must be used with the --type option. The exported type body is saved as a type file.

  • --package 'package_name [, package_name...]' | --package '*'

    Exports package definitions. This option is similar to the --table option, except that this option does not support data export. This option is supported only in the Oracle compatible mode of OceanBase Database.

  • --package-body 'packagebody_name [, packagebody_name...]' | --package-body '*'

    Exports package body definitions. This option is similar to the --table option, except that this option does not support data export. This option is supported only in the Oracle compatible mode of OceanBase Database.

  • --function 'function_name [, function_name...]' | --function '*'

    Exports function definitions. This option is similar to the --table option, except that this option does not support data export.

    Note

    Function definitions can be exported for OceanBase Database of any version in the Oracle compatible mode and OceanBase Database of V2.2.30 or later in the MySQL compatible mode.

  • --procedure 'procedure_name [, procedure_name...]' | --procedure '*'

    Exports stored procedure definitions. This option is similar to the --table option, except that this option does not support data export.

    Note

    Stored procedure definitions can be exported for OceanBase Database of any version in the Oracle compatible mode and OceanBase Database of V2.2.30 or later in the MySQL compatible mode.

Storage path

  • -f 'file_path', --file-path= 'file_path'

    The absolute path on a local disk for storing data files.

    Note

    If you use OBDUMPER V4.2.7 or later to export one file, you can use -f to specify the file name.

    • If you specify --query-sql, the default file name CUSTOM_SQL is used.
    • The log directory is generated in the parent directory of the path specified by -f.

    OBDUMPER allows you to export database object definitions and table data to local disks, Alibaba Cloud Object Storage Service (OSS), Amazon Simple Storage Service (S3), Tencent Cloud Object Storage (COS), and Huawei Cloud Object Storage Service (OBS). The syntax is as follows:

    [scheme://host]path[?parameters]
    
    parameters: key[=value],...
    
    Parameter Description
    scheme The storage scheme. Supported storage schemes are Alibaba Cloud OSS, Amazon S3, Tencent COS, and Huawei OBS.
    If the specified scheme is not one that is listed above, an error is returned.
    host The name of the storage space.
    When you export data to Alibaba Cloud OSS, Amazon S3, Tencent Cloud COS, or Huawei Cloud OBS, the host parameter specifies the bucket. For more information, see Bucket.
    path The data storage path in the storage space. The path must start with a slash (/).
    parameters The parameters required for the request.
    The value can be a single key or a key-value pair.

    The following table describes the supported parameters.

    Parameter Value required? Description Supported storage scheme Supported version
    endpoint Yes
    • The endpoint of the region where the OSS host resides.
    • The endpoint for accessing S3, COS, or OBS.
    OSS/S3/COS/OBS
    • OSS: V4.2.0
    • S3: V4.2.5
    • COS/OBS: V4.3.0
    region Yes The physical location of the bucket. S3/COS/OBS
    • S3: V4.2.0
    • COS/OBS: V4.3.0
    storage-class Yes The storage class of Amazon S3. S3 4.2.0
    access-key Yes The AccessKey ID used to access the bucket. OSS/S3/COS/OBS
    • OSS/S3: V4.2.0
    • COS/OBS: V4.3.0
    secret-key Yes The AccessKey secret used to access the bucket. OSS/S3/COS/OBS
    • OSS/S3: V4.2.0
    • COS/OBS: V4.3.0

    Here are some examples:

    • Export data to the local disk

      -f '/home/admin/foo/bar' 
      
    • Export data to Amazon S3

      -f 's3://bucket/path?region={region}&access-key={accessKey}&secret-key={secretKey}'
      
    • Export data to Alibaba Cloud OSS

      -f 'oss://mybucket/foo/bar?endpoint=myendpoint&access-key=myak&secret-key=mysk' 
      
    • Export data to Tencent Cloud COS

      -f 'cos://mybucket/foo?region=ap-shanghai&access-key=myak&secret-key=mysk'
      -f 'cos://mybucket/foo?endpoint=yourendpoint&access-key=myak&secret-key=mysk'
      
    • Export data to Huawei Cloud OBS

      -f 'obs://mybucket/foo?region=cn-north-1&access-key=myak&secret-key=mysk'
      -f 'obs://mybucket/foo?endpoint=yourendpoint&access-key=myak&secret-key=mysk'
      
  • --ctl-path 'control_path'

    The absolute path on a local disk for storing control files. You can configure built-in preprocessing functions in a control file. Data will be preprocessed by these functions before being exported. For example, the functions can perform case conversion and check the data for empty values. For information about the use of control files, see Data processing. When you specify this option on the CLI, enclose the value in single quotation marks (' '), for example, --ctl-path '/home/controls/'.

  • --log-path 'log_path'

    The output directory for the operational logs of OBDUMPER. If this option is not specified, OBDUMPER operational logs are stored in the directory specified by the -f option. Redirection is not required for log output, unless otherwise specified.

  • --no-nested-dir

    Exports all files to the directory specified by the -f option without generating nested subdirectories.

  • OBDUMPER exports data to the specified object storage service in Multipart-Upload mode. By default, the local file system is used as the temporary directory for storing temporary file blocks. You can also use the --tmp-path option to specify a storage directory. You can modify the following parameters in the script of OBDUMPER to adapt to the actual data export environment:

    • upload.buffer.type

      The buffer type. Valid values are disk and bytebuffer. The default value is disk, which specifies to store file blocks in the disk. In this case, The total size of file blocks that can be stored is subject to the maximum available space of the disk. bytebuffer specifies to store file blocks in the memory. This ensures high performance but occupies much JVM stack memory space.

    • upload.buffer.size

      The size of each file block, in bytes. The default value is 64 MB.

    • upload.active.blocks

      The maximum number of blocks (being uploaded or waiting to be uploaded in the queue) concurrently processed by each write thread. The default value is 2. When the specified value is exceeded, the tool is blocked until a file block is uploaded and removed from the queue.

      The --thread option specifies the maximum number of write threads. You can use the following formula to estimate the space that may be occupied by the buffer when the tool runs: Value of thread × Value of active.blocks × Value of buffer.size.

Other options

  • -H/--help

    Shows the help information about the tool.

  • -V/--version

    Shows the version of the tool.

Advanced options

Feature options

Timestamp formats

  • --flashback-timestamp 'timestamp_string'

    Exports data after a flashback point in time. This option can be used only with a data format option and cannot be used with the --query-sql option. This option is supported only in the Oracle compatible mode of OceanBase Database.

  • --nls-date-format 'date-format-string'

    The nls_date_format session variable in the Oracle compatible mode of OceanBase Database. This option does not specify to export data of the DATE data type in the specified format. The default value is YYYY-MM-DD HH24:MI:SS.

  • --nls-timestamp-format 'timestamp-format-string'

    The nls_timestamp_format session variable in the Oracle compatible mode of OceanBase Database. This option does not specify to export data of the TIMESTAMP data type in the specified format. The default value is YYYY-MM-DD HH24:MI:SS:FF9.

  • --nls-timestamp-tz-format 'timestamp-tz-format-string'

    The nls_timestamp_tz_format session variable in the Oracle compatible mode of OceanBase Database. This option does not specify to export data of the TIMESTAMP WITH TIME ZONE data type in the specified format. The default value is YYYY-MM-DD HH24:MI:SS:FF9 TZR.

  • --date-value-format

    The export format of the DATE data type. By default, the DATE data type is exported in the yyyy-MM-dd format in the MySQL compatible mode of OceanBase Database and in the yyyy-MM-dd HH:mm:ss format in the Oracle compatible mode of OceanBase Database.

    Note

    • This option can be used only with the --csv or --cut option.
    • the MySQL compatible mode of OceanBase Database, this option is unavailable when the date value is zero.
  • --time-value-format

    The export format of the TIME data type. By default, the TIME data type is exported in the HH:mm:ss format in the MySQL compatible mode of OceanBase Database. The precision is the same as that in the table definition.

    Note

    • This option can be used only with the --csv or --cut option.
    • In the MySQL compatible mode of OceanBase Database, this option is unavailable when the time value is zero.
  • --datetime-value-format

    The export format of the DATETIME data type. By default, the DATETIME data type is exported in the yyyy-MM-dd HH:mm:ss format in the MySQL compatible mode of OceanBase Database. The precision is the same as that in the table definition.

    Note

    • This option can be used only with the --csv or --cut option.
    • In the MySQL compatible mode of OceanBase Database, this option is unavailable when the datetime value is zero.
  • --timestamp-value-format

    The export format of the TIMESTAMP data type. By default, the TIMESTAMP data type is exported in the yyyy-MM-dd HH:mm:ss.SSSSSS format in both the MySQL compatible and the Oracle compatible modes of OceanBase Database. The precision is the same as that in the table definition.

    Note

    • This option can be used only with the --csv or --cut option.
    • In the MySQL compatible mode of OceanBase Database, this option is unavailable when the timestamp value is zero.
  • --timestamp-tz-value-format

    The export format of the TIMESTAMP WITH TIME ZONE data type. By default, the TIMESTAMP WITH TIME ZONE data type is exported in the yyyy-MM-dd HH:mm:ss.SSSSSS format in the Oracle compatible mode of OceanBase Database. The precision is the same as that in the table definition.

    Note

    This option can be used only with the --csv or --cut option.

  • --timestamp-ltz-value-format

    The export format of the TIMESTAMP WITH LOCAL TIME ZONE data type. By default, the TIMESTAMP WITH LOCAL TIME ZONE data type is exported in the yyyy-MM-dd HH:mm:ss format in the Oracle compatible mode of OceanBase Database. The precision is the same as that in the table definition.

    Note

    This option can be used only with the --csv or --cut option.

  • --preserve-zero-datetime

    Specifies whether to retain the original formats for zero values of datetime data types during export. If this option is specified, NULL values in datetime columns with NOT NULL constraints are exported as 0, and NULL values in nullable columns are still exported as NULL. You can specify this option for DATE, DATETIME, and TIMESTAMP data types in the MySQL compatible mode of OceanBase Database.

Allowlist- and blocklist-based filtering

  • Allowlist- and blocklist-based table filtering

    • --exclude-table 'table_name [, table_name...]'

      Excludes the specified tables from the export of table definitions or table data. Fuzzy match on table names is supported,

      for example, --exclude-table 'test1,test*,*test,te*st'.

      The preceding example specifies to exclude the following tables from the export of table definitions and table data:

      • test1

      • All tables with a table name starting with test

      • All tables with a table name ending with test

      • All tables with a table name starting with te and ending with st

    • --exclude-data-types 'datatype [, datatype...]'

      Excludes the specified data types from the export of data.

    • --add-extra-message

      Exports additional information in table definitions. For example, when you specify the --add-extra-message option on the CLI to export table definitions, OBDUMPER exports the name of the table group to which each table belongs. By default, OBDUMPER does not export the additional information contained in table definitions.

      Notice

      If you specify the --add-extra-message option to export table definitions, OBDUMPER exports the name of the table group to which each table belongs. This option depends on the privileges of the sys tenant. If OBDUMPER does not have the privileges of the sys tenant, do not specify this option.

    • --retain-empty-files

      Generates an empty file in specific export scenarios. If you specify the --partition option to export data from a specific partition or the --where option to export data that meets the specified query condition, you can also specify the --retain-empty-file option to generate an empty file when the partition or the query result set is empty.

  • Allowlist- and blocklist-based column filtering

    • --include-column-names 'column_name [, column_name...]'

      Includes the specified columns in the export of table data.

    • --exclude-column-names 'column_name [, column_name...]'

      Excludes the specified columns from the export of table data. Fuzzy match on column names is not supported.

      Notice

      • The letter case of the specified column name must be the same as that of the column name in the table definition.
      • The control file cannot take effect together with --exclude-column-names, as the control file incorporates the functionality of --exclude-column-names.
    • --where 'where_condition_string'

      Exports data that satisfies the specified conditions. This option can only be used with a data format option and cannot be used with the --query-sql option.

      If you also specify the --retain-empty-file option while the --where option is specified to export data that meets the query condition, an empty file can be generated when the query result set is empty.

    • --partition 'partition_name [, partition_name...]'

      Exports data of specified partitions. The option specifies the partition names. Separate multiple partition names with commas (,). This option can only be used with a data format option and cannot be used with the --query-sql option.

      Notice

      • When you specify a partition to export, you must specify the subpartition name for a subpartitioned table. You cannot export a partition by specifying only the partition name. For a template-based subpartition, its name is in the format of partition name+s+subpartition name.
      • When you specify the --partition option on the CLI to export data in a partition, you need to specify the name of the subpartition for a composite partitioned table. OBDUMPER cannot export data in a partition of a composite partitioned table. If the specified partition name does not exist, OBDUMPER returns an error.
      • If you also specify the --retain-empty-file option while the --partition option is specified to export data from a specific partition, an empty file can be generated when the partition is empty.
    • --query-sql

      • --query-sql '<select_statement>': directly specifies the query statement, for example, --query-sql 'select c1,c2 from test where c1 is not null'.

        This syntax exports the result set of a custom query statement. This option cannot be used with the --partition or --where option. You must ensure the correctness and query performance of the custom query statement. When you export the result set of a large query, you may wait for a long time before the database responds. To preprocess data to be exported by using a control file, you must use the --table and --ctl-path options. The --table option must be set to the table name exactly the same as that specified in --ctl-path. If preprocessing is not required, you can specify the --table option as any table name.

      • --query-sql 'file://xxxx': specifies the file that stores the query statement, for example, --query-sql 'file:///home/admin/t1.sql'.

        OBDUMPER identifies the protocol header file:// and directly reads the query statement from the file. You can use this syntax if the query statement is excessively long. You can specify only one SQL statement in a file.

    • --exclude-virtual-columns

      Specifies not to export the data of generated columns. By default, the data of generated columns is exported.

    • --enable-hidden-pk

      Specifies whether to use a hidden primary key __pk_increment for a table without a primary key to accelerate export. If you specify this option in OceanBase Database earlier than V4.0.0, you must create a special user to export data. Here is an example:

      # In the MySQL compatible mode of OceanBase Database, log in as the root user, create a special user, and grant privileges to the user.
      create user '__oceanbase_inner_drc_user'@'%' IDENTIFIED BY 'u*******';
      grant ALL on *.* to '__oceanbase_inner_drc_user' WITH GRANT OPTION;
      
      # In the Oracle compatible mode of OceanBase Database, log in as the SYS user, create a special user, and grant privileges to the user.
      create user '__OCEANBASE_INNER_DRC_USER'@'%' IDENTIFIED BY u*******;
      grant ALL to '__OCEANBASE_INNER_DRC_USER';
      

      Notice

      We recommend that you set a local index for a partitioned table in OceanBase Database V3.x. The syntax is create index "your index" on `your table` ("__pk_increment") local;.

    • --fetch-size 'int_num'

      The number of rows read from the database cursor in the Oracle compatible mode of OceanBase Database. The default value is 1000. For more information, see FetchSize.

      Note

      To use this option, you must install the OceanBase Connector/J driver.

Error handling

  • --retry

    Resumes the export task from the location of the last export failure.

    Notice

    The dump.ckpt file is a savepoint file generated when the tool runs and is located in the directory specified by the -f option. You cannot use this option if the dump.ckpt file does not exist.

  • --weak-read

    Exports data from the follower replica. For more information, see Weak-consistency read.

  • --max-file-size int_num

    The maximum size of data that a process can export. Data export stops when the size of the export file reaches the limit.

  • --skip-check-dir

    Skips checking on whether the data export directory is empty. When the export directory is not empty, the tool stops exporting.

    Note

    • If this option is not specified, OBDUMPER checks whether the export directory is empty. If the export directory is not empty, OBDUMPER returns an error and exits.
    • If this option is specified, OBDUMPER skips the check. In this case, an exported file may overwrite an existing file with the same name in this directory.
  • --remove-newline

    Forcibly deletes carriage returns or line breaks in the data before the data export. For example, ***\r***, ***\n***, and \r\n are deleted. This option only modifies the data retrieved to the memory and does not modify the data in the source table. This option can be used only with the --cut option.

    Notice

    If data in the source table contains carriage returns or line breaks, the data exported with this option specified is inconsistent with that in the source table. Before you use this option, make sure that the removal of \r, \n, and \r\n does not affect your business. If you do not need to delete carriage returns or line breaks in the data, to avoid data inconsistency, do not specify this option in the command.

  • --snapshot

    Exports data of a historical version. This option can be used only with a data format option. You can export data of a historical version to ensure the global consistency of the exported data. If this option is not specified, the real-time data exported from the memory may not be a globally consistent data snapshot.

Performance options

  • --page-size int_num

    The page size, namely, the number of rows queried at a time. The default value is 1000000, which specifies to query 1 million rows at a time. This option is used in OBDUMPER of a version later than V4.0.0.

  • --thread int_num

    The number of concurrent threads allowed. This option corresponds to the number of export threads. The default value is the number of CPU cores multiplied by 2. If the number of CPU cores is greater than 16, the maximum value is 32. We recommend that you set the --thread option to a value within 4 for exporting the definitions of multiple database objects. High concurrency affects access to system tables in the sys tenant, resulting in timeout errors during data export.

  • --block-size

    The block size for a file to be exported. This option is supported for the LONG and STRING data types. If the size of the data file to be exported exceeds the value of this option, the file is split into logical subfiles. When you specify this option, you do not need to explicitly specify the unit. The default unit is MB. The default value is 1024. This option does not take effect for ORC and Parquet formats. OBDUMPER V4.1.0 and later versions allow you to specify the maximum number of rows in each sub-file for data file splitting. The unit of --block-size can be MB or ROW. For example, --block-size 256ROW indicates that the size of a file cannot exceed 256 rows, and --block-size 1024 or --block-size 1024MB indicates that the size of a file cannot exceed 1024 MB. The formats of 1024M and 1GB are not supported.

    Notice

    When you use --block-size, you must specify -f as a directory.

  • --parallel-macro int_num

    The number of macroblocks that can be processed by each export thread. The default value is 8.

  • --mem

    Supported in OBDUMPER V4.3.2 and later. This option specifies the memory size of the JVM. Valid units are K, M, G, and T. The default value is 4G.

Other options

  • --session-config

    Specifies the connection configuration file. The program package provides a default configuration file named session.config.json in the <root directory of the tool>/conf directory. It takes effect without modification. We recommend that you specify this option if you want to load multiple connection configurations by using one program package.

Quick reference table of options

Option Required? Description Introduced in Deprecated?
-h(--host) Yes The host IP address for connecting to ODP or a physical OceanBase Database node.
-P(--port) Yes The host port for connecting to ODP or a physical OceanBase Database node.
-u(--user) Yes The username, tenant name, and cluster name, in the format of <user>@<tenant>#<cluster>. Yes
-p(--password) No The password used to log in to the database.
-D(--database) Yes The name of the database.

Note

OBDUMPER can export the data of only one database at a time.

-f(--file-path) Yes The directory to which data is exported.
--no-nested-dir No Exports data to a non-nested directory. V4.2.7
--sys-user No The name of the user in the sys tenant.
--sys-password No The password of the user in the sys tenant.
-t No The tenant name used to log in to OceanBase Database. This option is used with the --public-cloud option.

Notice

You must use this option with the --public-cloud -t option in direct load from cloud storage.

--public-cloud No Imports database object definitions or table data from an ApsaraDB for OceanBase cluster.

Notice

You must use this option with the --public-cloud -t option in direct load from cloud storage.

--log-path No The directory where log files are stored.
--ddl No Exports DDL files.
A DDL file stores database object definitions, and is named in the format of object name-schema.sql. When this option is specified, only the database object definitions are exported, and table data is not exported. We recommend that you set the --thread option to a value less than 4 for exporting the definitions of multiple table objects. High concurrency affects access to views in the sys tenant, resulting in timeout errors during data export.
--csv No Exports data files in the CSV format. This option is recommended.
A CSV file stores data in the standard CSV format, and is named in the format of table name.csv. For information about CSV format specifications, see the definitions in RFC 4180. Delimiter errors are the most common errors that occur in CSV files. Single or double quotation marks are usually used as the delimiter. If data in the file contains the delimiter, you must specify escape characters. For more information, see symbol options in the CSV format. We recommend that you use the CSV format. We recommend that you use this option with the --table option. When this option is used with the --all option, OBDUMPER exports only table data but not database object definitions.
--sql No Exports data files in the SQL format, which is different from DDL files.
An SQL file stores data in the format of INSERT statements, and is named in the format of table name.sql. Each line of table data corresponds to an executable INSERT statement in an SQL file. An SQL file is different from a DDL file in terms of content format. We recommend that you use this option with the --table option. When this option is used with the --all option, OBDUMPER exports only table data but not database object definitions.
--orc No Exports data files in the ORC format.
An ORC file stores data in the column-oriented format, and is named in the format of table name.orc. For more information about ORC format definitions, see ORC Specification.
V4.0.0
--par No Exports data files in the Parquet format.
A Parquet file stores data in the column-oriented format. The file is named in the format of table name.parquet. For more information about Parquet format definitions, see File Format on the official Apache Parquet website.
V4.0.0
--cut No Exports data files in the CUT format.
A CUT file uses a character string as the separator string, and is named in the format of table name.dat. We recommend that you use this option with the --table option. When this option is used with the --all option, OBDUMPER exports only table data but not database object definitions.

Notice

In a CUT file, each data record is stored in an entire line. When a single character is used as the field separator, if the data contains special characters such as separators, carriage returns, and line breaks, OBDUMPER escapes these special characters. For example, if the data is abc|def and the separator is |, the exported data is abc\|def.

--all No Exports all supported database object definitions and table data.
--table-group No Exports table group definitions. V3.1.0
--table No Exports table definitions or table data.
--view No Exports view definitions.
--function No Exports function definitions.
--procedure No Exports stored procedure definitions.
--trigger No Exports trigger definitions.
--sequence No Exports sequence definitions.
--synonym No Exports synonym definitions. This option is not supported for MySQL-compatible tenants.
--type No Exports type definitions. V4.0.0
--type-body No Exports type body definitions.
--package No Exports package definitions.
--package-body No Exports package body definitions.
--drop-object No Prepends a DROP statement when DDL statements are exported. This option can be used only with the --ddl option.
--distinct No Exports non-duplicate data in the table. Yes
--with-trim No Deletes the space characters on the left and right sides of the data. V4.2.0
--weak-read No Exports table data in the follower replica, which is different from a standby cluster.
--query-sql No Exports the result set of a custom SQL query statement.
--snapshot No Exports data after the last major compaction.
--where No Exports data that meets specified conditions.
--partition No Exports data in specified partitions.
--skip-header No A boolean value that specifies whether to ignore the header of CSV files, which is the first line of data.
--trail-delimiter No Truncates the last column separator in a line.
--null-string No Replaces NULL with the specified character. Default value: \N. This option can be used only with the --csv or --cut option.
--empty-string No Replaces an empty string (' ') with the specified character. The default value is \E. This option can be used only with the --csv or --cut option. The default value is \E.
--line-separator No The line separator. The default value of this option is relevant with the system platform. Valid values are \r, \n, and \r\n.
--file-encoding No The file character set, which is different from the database character set.
When you specify this option on the CLI, enclose the value in single quotation marks (' '), such as --file-encoding 'GBK'. Default value: UTF-8.
--column-separator No The column separator, This option can be used only with the --csv option and supports a single character only. The default value is comma (,). It is different from the column separator string in the CUT format.
--escape-character No The escape character. This option can be used only with the --csv or --cut option and supports a single character only.
  • If you use it with the --csv option, the default value is null.
  • If you use it with the --cut option, the default value is \.

Note

To set this option to special (invisible) characters, you can represent the characters in their hexadecimal format. For example, you can use '\x09' to represent an invisible tab character.

--column-delimiter No The column delimiter. This option can be used only with the --csv option and supports a single character only. The default value is single quotation mark (').
--column-splitter No The column separator string, which is different from the column separator in the CSV format.
--flashback-scn No Exports data after the flashback transaction point.
This option can be used only with a data format option and cannot be used with the --query-sql option.
--flashback-timestamp No Exports data after the flashback point in time. This option is supported only in the Oracle compatible mode of OceanBase Database V2.2.70 and later.
--nls-date-format No The session-level datetime format. This option is supported only in the Oracle compatible mode of OceanBase Database.
--nls-timestamp-format No The session-level timestamp format. This option is supported only in the Oracle compatible mode of OceanBase Database.
--nls-timestamp-tz-format No The session-level timestamp format with a time zone. This option is supported only in the Oracle compatible mode of OceanBase Database.
--retry No Re-exports data from the last savepoint.
--ctl-path No The directory of the control files.
--exclude-table No Excludes the specified tables from the export of table definitions and table data.
--exclude-column-names No Excludes the specified columns from the export of data.
--exclude-data-types No Excludes the specified data types from the export of data.
--include-column-names No Includes the specified columns in the export of table data.
--remove-newline No Forcibly deletes line breaks or carriage returns in the data. This option applies only to the CUT format.
--max-file-size No The maximum size of data that a process can export, in bytes.
--skip-check-dir No Skips checking on whether the data export directory is empty. The data export directory must be empty.
--retain-empty-files No Generates an empty file by default for the export of an empty table.
--add-extra-message No Exports additional information in the table creation statement, such as the table group information.
--page-size No The page size in a query statement executed during export. Default value: 1000000.
--thread No The number of concurrent export threads allowed.
--block-size No The size of a file. Default value: 1024MB.
--parallel-macro No The number of macroblocks processed by each export thread.
--mem false OBDUMPER V4.3.2 and later versions support this parameter to specify the memory size of the Java Virtual Machine (JVM). Valid units include K, M, G, and T. The default value is 4G.
--fetch-size No The number of rows read from the database cursor at a time in the Oracle compatible mode of OceanBase Database. V4.2.0
-V(--version) No Shows the version of OBDUMPER.
--date-value-format No The export format of the DATE data type. V3.2.0
--time-value-format No The export format of the TIME data type in the MySQL compatible mode of OceanBase Database. V3.2.0
--datetime-value-format No The export format of the DATETIME data type in the MySQL compatible mode of OceanBase Database. V3.2.0
--timestamp-value-format No The export format of the TIMESTAMP data type in the MySQL compatible or Oracle compatible mode of OceanBase Database. V3.2.0
--timestamp-tz-value-format No The export format of the TIMESTAMP WITH TIME ZONE data type in the Oracle compatible mode of OceanBase Database. V3.2.0
--timestamp-ltz-value-format No The export format of the TIMESTAMP WITH LOCAL TIME ZONE data type in the Oracle compatible mode of OceanBase Database. V3.2.0
--exclude-virtual-columns No Specifies not to export the data of generated columns. By default, the data of generated columns is exported. V3.2.0
--no-sys No Specifies that the password of the sys tenant cannot be provided in OceanBase Database. 3.3.0
--logical-database No Exports data by using ODP (sharding). V3.3.0
--character-set No The character set for creating a database connection.
The default value is the value specified by the session variable jdbc.url.character.encoding in the session.properties file. The value of the --character-set option overrides that of the jdbc.url.character.encoding variable. Supported character sets include binary, gbk, gb18030, utf16, and utf8mb4.
V4.2.4
--preserve-zero-datetime No Specifies whether to retain the original formats for zero values of datetime data types during export. V4.2.4
--enable-hidden-pk No Specifies whether to use a hidden primary key for a table without a primary key. V4.2.5
--session-config No Specifies the connection configuration file. V4.2.6
-H(--help) No Shows the help information of the OBDUMPER command-line tool.

Previous topic

Quick start
Last

Next topic

Define control files
Next
What is on this page
Overview
Option styles
Option categories
Required options
Basic options
Connection options
Feature options
Other options
Advanced options
Feature options
Performance options
Other options
Quick reference table of options