OceanBase logo

OceanBase

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

Product Overview
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

OceanBase

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

Product Overview
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.2.4Community Edition

  • Document Overview
  • Introduction
  • Quick start
  • Preparations
    • Prepare the environment
    • Download OBLOADER & OBDUMPER
  • User Guide (OBLOADER)
    • OBLOADER overview
    • Command-line options
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • Scenarios and examples
    • Error handling
    • FAQ
  • User Guide (OBDUMPER)
    • OBDUMPER overview
    • Command-line options
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • Scenarios and examples
    • FAQ
  • Security features
  • Connection settings
  • Self-service troubleshooting
  • Release Note
    • Release Note
      • 4.x
        • 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 Quick start Prepare the environment Download OBLOADER & OBDUMPER OBLOADER overviewCommand-line optionsDefine control filesPreprocessing functionsCase expressionsPerformance tuningScenarios and examples Error handlingFAQ OBDUMPER overview Command-line optionsDefine control filesPreprocessing functionsCase expressions Performance tuningScenarios and examplesFAQ 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.2.4
iconOceanBase Loader and Dumper
V 4.2.4Community Edition
  • V 4.3.6
  • 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

Command-line options

Last Updated:2026-04-13 06:25:24  Updated
share
What is on this page
Options
Connection options
Feature options
Performance options
Other options

folded

share

OBDUMPER allows you to specify the information required for export in command-line options. For more information about the options and their scenarios and examples, see Options and Scenarios and examples.

Options

Option Required? Description Introduced in Deprecated?
-h(--host) Yes The host IP address for connecting to OceanBase Database Proxy (ODP) or a physical OceanBase Database node.
-P(--port) Yes The host port for connecting to ODP or a physical OceanBase Database node.
-c(--cluster) No The cluster name of the database.
-t(--tenant) No The tenant name of the cluster.
-u(--user) Yes The username that you use to log on to the database.
-p(--password) No The password that you use to log on to the database.
-D(--database) Yes The name of the database.
-f(--file-path) Yes The directory to which data is exported.
--sys-user No The name of the user in the sys tenant.
--sys-password No The password of the user in the sys tenant.
--public-cloud No The public cloud operating environment.
--log-path No The directory to which log files are exported.
--ddl No Specifies to export DDL files.
--csv No Specifies to export data files in the CSV format (recommended).
--sql No Specifies to export data files in SQL format, which is different from DDL files.
--orc No Specifies to export data files in the ORC format. V4.0.0
--par No Specifies to export data files in the Parquet format. V4.0.0
--cut No Specifies to export data files in the CUT format.
--all No Specifies to export all supported database object definitions and table data.
--table-group No Specifies to export table group definitions. V3.1.0
--table No Specifies to export table definitions or table data.
--view No Specifies to export view definitions.
--function No Specifies to export function definitions.
--procedure No Specifies to export stored procedure definitions.
--trigger No Specifies to export trigger definitions.
--sequence No Specifies to export sequence definitions.
--synonym No Specifies to export synonym definitions. This option is not supported for MySQL tenants.
--type No Specifies to export type definitions. V4.0.0
--type-body No Specifies to export type body definitions.
--package No Specifies to export package definitions.
--package-body No Specifies to export package body definitions.
--drop-object No Specifies to prepend DROP statement when DDL statements are exported.
--distinct No Specifies to export non-duplicate data in the table. Yes
--with-trim No Specifies to delete the space characters on the left and right sides of the data. V4.2.0
--weak-read No Specifies to export table data in the follower replica, which is different from a standby cluster.
--query-sql No Specifies to export the result set of a custom SQL query statement.
--snapshot No Specifies to export data after the last major compaction.
--where No Specifies to export data that meets specified conditions.
--partition No Specifies to export data in specified partitions.
--skip-header No Specifies to skip headers of CSV files when the files are exported.
--trail-delimiter No Specifies to truncate the last column separator in a line.
--null-string No Specifies to replace NULL with the specified character. Default value: \\N.
--empty-string No Specifies to replace an empty string (' ') with the specified character. Default value: \\E.
--line-separator No The custom line separator. Default value: \\n.
--file-encoding No The file character set, which is different from the database character set.
--column-separator No The column separator, which is different from the column separator string in the CUT format.
--escape-character No The escape character. Default value: \\.
--column-delimiter No The column delimiter. Default value: '.
--column-splitter No The column separator string, which is different from the column separator in the CSV format.
--flashback-scn No Specifies to export data after the flashback transaction point, which is supported only in OceanBase Database V2.2.70 and later in Oracle mode.
--flashback-timestamp No Specifies to export data after the flashback point in time, which is supported only in OceanBase Database V2.2.70 and later in Oracle mode.
--nls-date-format No The session-level datetime format, which is supported only for OceanBase Database in Oracle mode.
--nls-timestamp-format No The session-level timestamp format, which is supported only for OceanBase Database in Oracle mode.
--nls-timestamp-tz-format No The session-level timestamp format with a time zone, which is supported only for OceanBase Database in Oracle mode.
--retry No Specifies to export data from the last savepoint.
--ctl-path No The directory of the control files.
--exclude-table No Specifies to excludethe specified tables from the export of table definitions and table data.
--exclude-column-names No Specifies to excludethe specified columns from the export of data.
--exclude-data-types No Specifies to excludethe specified data types from the export of data.
--include-column-names No Specifies to export data in the specified field order.
--file-name No Specifies to merge sub-files exported from each table into one large file.
--remove-newline No Specifies to force delete line breaks or carriage returns in the data. It applies only to the CUT format.
--max-file-size No The maximum amount of data to be exported for each table. Default unit: MB.
--skip-check-dir No Specifies to skip checking on whether the data export directory is empty. The data export directory must be empty.
--retain-empty-files No Specifies to generate an empty file by default for the export of an empty table.
--add-extra-message No Specifies to export 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 block size for a file to be imported. Default value: 1024 MB.
--parallel-macro No The number of macroblocks processed by each export thread.
--fetch-size No The number of rows read from the database cursor at a time in Oracle mode of OceanBase Database. V4.2.0
-V(--version) No Specifies to show 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 MySQL mode of OceanBase Database. V3.2.0
--datetime-value-format No The export format of the DATETIME data type in MySQL mode of OceanBase Database. V3.2.0
--timestamp-value-format No The export format of the TIMESTAMP data type in MySQL/Oracle mode of OceanBase Database. V3.2.0
--timestamp-tz-value-format No The export format of the TIMESTAMP WITH TIME ZONE data type in Oracle 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 Oracle 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 not to provide the password for the sys tenant in the private cloud environment. V3.3.0
--logical-database No Specifies to export data by using ODP (Sharding). V3.3.0
--storage-uri No The uniform resource identifier (URI) of the storage space. V4.2.0
--upload-behavior No The upload mode for exporting data to the cloud storage space. V4.2.0
--character-set No The character set used when you create a database connection. 4.2.4
--preserve-zero-datetime No Specifies whether to reserve the original format of zero values of the TIME type. 4.2.4
-H(--help) No Specifies to show the help information of the OBDUMPER command-line tool.

Connection options

OBDUMPER can read data from and write data to an OceanBase database only after connecting to the database. You can connect to an OceanBase database by specifying the following options:

  • -h host_name , --host= host_name

    The host IP address for connecting to ODP or a physical OBServer node.

  • -P port_num , --port= port_num

    The host port for connecting to ODP or a physical OBServer node.

  • -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 IP address and port of the physical node of the database. If this option is specified, ODP is connected. The -h and -P options specify the IP address and port of ODP.

  • -t tenant_name , --tenant= tenant_name

    The OceanBase Database tenant to connect to. For more information about tenants, see the official OceanBase Database documentation.

  • -u user_name , --user= user_name

    The username for connecting to OceanBase Database. If you specify an incorrect username, OBDUMPER cannot connect to the database.

  • -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 command line, you must enclose the value in single quotation marks (' '). Example: -p'******'.

    Note

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

  • -D database_name , --database= database_name

    Specifies to export database object definitions and table data from the specified database.

  • --sys-user sys_username

    The username of a user with required privileges in the sys tenant, for example, root or proxyro. OBDUMPER requires such a user to query metadata in system tables. Default value: root. You do not need to specify this option for 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 along with --sys-user. By default, the password of the root user in the sys tenant is left empty. When you specify this option on the command line, enclose the value in single quotation marks (' '). Example: --sys-password '******'. You do not need to specify this option for 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.

  • --public-cloud

    Specifies to export database objects or table data in an OceanBase cluster deployed in the public cloud to a file. If you specify this option on the command line, you do not need to specify the -t or -c connection option. OBDUMPER turns on the --no-sys option by default. For more information about the --no-sys option, see the corresponding option description.

  • --no-sys

    Specifies to export database objects or table data to OceanBase clusters deployed in the private cloud when you cannot provide the password of the sys tenant. Unlike the --public-cloud option, when you use the --no-sys option, you need to specify the -t connection option on the command line and also need to add the -c option to connect to the ODP service. In OceanBase Database V4.0.0 and earlier, if you do not specify the --public-cloud or --no-sys option, you must specify the --sys-user and --sys-password option in OBDUMPER.

  • --logical-database

    Specifies to export data by using ODP (Sharding). When you specify the --logical-database option on the command line, the definition of a random physical database shard is exported and the shard cannot be directly imported into the database. You need to manually convert the exported physical shard to a logical one before you import it to the database for business use.

Feature options

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

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

  • --file-encoding ' encode_name '

    The character set used during file export, which is not the database character set. When you specify this option on the command line, enclose the value in single quotation marks (' '). Example: --file-encoding 'GBK'. Default value: UTF-8.

  • --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 the use of control files, see Data processing. When you specify this option on the command line, enclose the value in single quotation marks (' '). 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. Unless in special circumstances, redirection is not required for log output.

  • --ddl

    Specifies to export DDL files. A DDL file stores database object definitions. The file 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.

  • --sql

    Specifies to export data files in SQL format. In an SQL file, data is stored in the format of INSERT statements. The file 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 together with the --table option. When it is used together with the --all option, OBDUMPER exports only table data but not database object definitions.

  • --orc

    Specifies to export data files in the ORC format. An ORC file stores data in a column-oriented format. The file is named in the format of table name.orc. For more information about ORC format definitions, see Apache ORC. By default, all ORC files use the String type compression for data storage.

  • --par

    Specifies to export data files in the Parquet format. A Parquet file stores data in a column-oriented format. The file is named in the table name.parquet format. For more information about Parquet format definitions, see Apache Parquet. By default, all Parquet files use the String type compression for data storage.

  • --csv

    Specifies to export data files in the CSV format. In a CSV file, data is stored in the standard CSV format. The file is named in the format of table name.csv. For 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 strongly recommend that you use the CSV format. We recommend that you use this option together with the --table option. When it is used together with the --all option, OBDUMPER exports only table data but not database object definitions.

  • --cut

    Specifies to export data files in the CUT format. A CUT file is a format that uses a character string as the separator string. A CUT file is named in the format of table name.dat. We recommend that you use this option together with the --table option. When it is used together 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 will escape these special characters. For example, if the data is abc|def and the separator is |, the exported data is abc|def.

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

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

  • --all

    Specifies to export all database object definitions and table data. When this option is used in combination with --ddl, all database object definitions are exported. When this option is used in combination with --csv, --sql, or --cut, data in all tables is exported in the specified format. To export all database object definitions and table data, you can specify --all and --ddl 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 ' table_name [,table_name...] ' | --table ' * '

    Specifies to export table definitions or table data. When this option is used in combination with --ddl, only table definitions are exported. When this option is used in combination with any data format option, only table data is exported. To specify multiple tables, separate the table names with commas (,). By default, for OceanBase Database in Oracle mode, the table names are in uppercase, and for OceanBase Database in MySQL mode, the table names are in lowercase. For example, for OceanBase Database in Oracle mode, both --table 'test' and --table 'TEST' indicate the table named TEST. For OceanBase Database in MySQL mode, both --table 'test' and --table 'TEST' indicate the table named test. If table names are case-sensitive, enclose them 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 and data are exported.

    Note

    You can use OBDUMPER V4.1.0 and later versions to export temporary table definitions from Oracle tenants of OceanBase Database.

  • --view ' view_name [, view_name...] ' | --view ' * '

    Specifies to export 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 ' * '

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

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

    Specifies to export 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 versions apply to Oracle tenants of OceanBase Database only. OBDUMPER 4.1.0 and later versions apply to both MySQL and Oracle tenants of OceanBase Database.

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

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

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

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

    Note

    You can export type definitions only in OceanBase Database V2.2.77 and later.

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

    Specifies to export 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 for OceanBase Database in Oracle mode.

    Note

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

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

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

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

    Specifies to export 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 for OceanBase Database in Oracle mode.

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

    Specifies to export 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 in all versions of OceanBase Database in Oracle mode. Function definitions can be exported in V2.2.30 and later of OceanBase Database in MySQL mode.

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

    Specifies to export 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 in all versions of OceanBase Database in Oracle mode. Stored procedure definitions can be exported in V2.2.30 and later of OceanBase Database in MySQL mode.

  • --drop-object

    Inserts a DROP statement before the database object creation statement for the export of a DDL file. This option can be used only in combination with the --ddl option.

  • --snapshot

    Specifies to export data of a historical version. This option can be used only in combination 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.

  • --where ' where_condition_string '

    Specifies to export data that satisfies the specified conditions. This option can only be used together with a data format option and cannot be used in combination with the --query-sql option.

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

    Specifies to export data of specified partitions. The option specifies the partition names. Separate multiple partition names with commas (,). This option can only be used together with a data format option and cannot be used in combination 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.

  • --query-sql ' select_statement '

    Specifies to export the result set of a custom query statement. This option cannot be used in combination 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 need to 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.

  • --flashback-scn ' scn_number '

    Specifies to export data after a system change number (SCN) transaction point. This option can only be used with a data format option and cannot be used in combination with the --query-sql option. This option is supported only for OceanBase Database in Oracle mode.

  • --flashback-timestamp ' timestamp_string '

    Specifies to export data after a flashback point in time. This option can only be used with a data format option and cannot be used in combination with the --query-sql option. This option is supported only for OceanBase Database in Oracle mode.

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

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

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

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

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

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

  • --retry

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

    Notice

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

  • --distinct

    Filters duplicate data in a table. This option is used only in combination with the --cut option.

    Notice

    This option is deprecated. Do not use it.

  • --with-trim

    Specifies to delete the space characters on the left and right sides of the data. This option is used only in combination with the --cut or --csv option.

  • --weak-read

    Specifies to export data from the follower replica. OBDUMPER of versions earlier than V3.1.0 can be used only with ODP V3.1.2 and later. For OBDUMPER V3.1.0 and later, you must configure ob.proxy.route.policy=follower_first in the conf/session.properties file. For the usage of the session.properties file, see the "Set session-level variables" section in the Scenarios and examples topic of the OBDUMPER documentation.

  • --file-name ' file_name '

    Specifies to merge subfiles exported from a table into one large file.

    Note

    • If this option is specified, the file name can contain an extension. Example: --file-name test.txt.
    • If you set this option to a custom path, you cannot use OBLOADER to import the entire directory of the exported data. This is because the directory structure generated by OBDUMPER is changed to the custom path and OBLOADER cannot recognize it.

    Example:

    Usage Description Example
    --file-name {file_name} Specifies to merge sub-files exported from one table or schema.
    Sub-files exported from the single table are merged into one file, which is named as the value of file_name. The paths of the exported schema and record files remain unchanged.
    Specify the following options:
    • -f='/home/admin/foo'
    • --file-name='custom.dat'
    • --table='t_origin'
    Task result: All record files of the t_origin table are merged into the custom.dat file in the /home/admin/foo/data/{schema}/TABLE/ directory.
    --file-name {*} Specifies to merge sub-files exported from one or more tables into one or more files.
    Sub-files exported from the specified tables are merged into n files that are named after the corresponding tables, where n equals the number of the corresponding tables. The paths of the exported schemas and record files remain unchanged.
    Specify the following options:
    • -f='/home/admin/foo'
    • --file-name='*'
    • --table='*'
    Task result: All record files are merged into the files of the corresponding table names in the /home/admin/foo/data/{database}/TABLE directory. All schema files are in their original positions.
    Note
    We recommend that you do not use --file-name '*' together with the --skip-check-dir option, because the --skip-check-dir option merges existing data files of the same table names in the path, resulting in issues such as data duplication.
    --file-name {file_path} Specifies to merge sub-files exported from a single table or a single schema. You can specify a relative or absolute path. Use this option only when --ddl is not specified. The file name for exporting a schema is different from that for exporting records.
    1. Specifies to merge sub-files exported from a single table into one file and moves the file to the file path specified by file_path.
    2. If you specify --ddl but do not specify any data format, only the exported schema file is moved to the file path specified by file_path.
    • To export a schema, specify the following options:
      • --table='custom'
      • -f='/home/admin/foo'
      • --file-name='/home/admin/bar/custom.ddl'
      Task result: The DDL statements for the custom table are exported to the custom.ddl file in the /home/admin/bar/ directory.
    • To export record files, specify the following options:
      • --table='custom'
      • -f='/home/admin/foo'
      • --file-name='/home/admin/bar/custom.dat'
      Task result: The exported record files are merged into the custom.dat file in the /home/admin/bar/ directory.
    --file-name {directory_path} A directory must end with a slash (/) and cannot contain \*.
    Specifies to merge sub-files exported from one or more tables into one or more files. You can specify a relative or absolute path. Sub-files exported from the specified tables are merged into n files that are named after the corresponding tables, where n equals the number of the corresponding tables. The files are then stored in the directory specified by directory_path.
    Specify the following options:
    • -f='/home/admin/foo'
    • --file-name='/home/admin/bar/'
    • --table='*'
    Task result: All record files are grouped and merged by table name and moved together with all schema files to the /home/admin/bar/ directory.


  • --max-file-size int_num

    The maximum size of a file. Data export stops if the size of the export file reaches the limit.

  • --skip-check-dir

    Specifies to skip checking on whether the data export directory is empty. Data export stops if the export directory is not empty.

  • --remove-newline

    Specifies to force delete carriage returns or line breaks in the data before the data export. For example, ***\r***, ***\n***, and \r\n will be 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 in combination with the --cut option.

    Notice

    If data in the source table contains carriage returns or line breaks, the data exported with this option specified will be inconsistent with that in the source table. Before using this option, ensure that the removal of \r, \n, and \r\n does not affect the 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.

  • --retain-empty-files

    Specifies to generate an empty file for each empty table. If this option is not specified, no file is generated for an empty table during data export.

  • --add-extra-message

    Specifies to export additional information in table definitions. For example, when you specify the --add-extra-message option on the command line 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.

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

    Specifies to excludethe specified tables from the export of table definitions or table data. Fuzzy match on table names is supported.

    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 the table name starting with test
    • All tables with the table name ending with test
    • All tables with the table name starting with te and ending with st

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

    Specifies to excludethe specified data types during the data export.

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

    Includes the specified columns in the export of table data. Data of the columns is exported in the specified order.

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

    Specifies to excludethe specified columns during 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.

  • --skip-header

    Specifies to skip headers of CSV files when the files are exported. This option is used only in combination with the --csv option.

  • --trail-delimiter

    Specifies to truncate the last column separator in a line. This option is used only in combination with the --cut or --csv option.

  • --null-string ' null_replacer_string '

    Specifies to replace NULL with the specified character. This option can be used only in combination with the --cut or --csv option. Default value: \\N.

  • --empty-string ' empty_replacer_string '

    Specifies to replace an empty string (' ') with the specified character. This option can be used only in combination with the --csv option. Default value: \\E.

  • --line-separator ' line_separator_string '

    The custom line break for the data file. The default value of this option depends on the system platform. Valid values: \\r, \\n, and \\r\\n.

Note

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

  • --column-separator ' column_separator_char '

    The column separator. This option can be used only in combination with the --csv option and supports a single character only. Default value: comma (,).

  • --escape-character ' escape_char '

    The escape character. This option can be used only in combination with the --cut or --csv option and supports a single character only. Default value: backslash ().

  • --column-delimiter ' column_delimiter_char '

    The column delimiter. This option can be used only in combination with the --csv option and supports a single character only. Default value: single quotation mark (').

  • --column-splitter ' split_string '

    The column separator string. This option is used only in combination with the --cut option.

  • --fetch-size ' int_num '

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

    Note

    To use this option, you must install the OceanBase JDBC driver.

  • --upload-behavior ' upload_behavior_string '

    The upload mode for exporting data to cloud storage space. This option supports the FAST and COMPLETE upload modes. FAST: Data files are uploaded immediately after they are exported to the local disk. COMPLETE: Data files are uploaded in batches after all of them are exported. This mode applies to scenarios where sub-files need to be merged and moved.

  • --storage-uri ' storage_uri_string '

    The URI of the storage space. OBDUMPER V4.2.0 and later allow you to export data to Alibaba Cloud OSS and Amazon S3.

    Syntax of 'storage_uri_string':

    [scheme://host]path[?parameters]
    
    parameters: key[=value],...
    

    Parameters:

    Parameter Description
    scheme The storage scheme. Alibaba Cloud OSS and Amazon S3 are supported.
    If the scheme is not Alibaba Cloud OSS or Amazon S3, an error is returned.
    host_name The name of the storage space.
    When you export data to Alibaba Cloud OSS or Amazon S3, the host parameter specifies the bucket. For more information, see OSS 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 multiple key-value pairs.

    Example: Export data to Amazon S3

    --storage-uri 's3://bucket/path?region={region}&access-key={accessKey}&secret-key={secretKey}'
    
  • s3: indicates that the storage scheme is Amazon S3.
  • bucket: the name of the bucket in Amazon S3.
  • path: the data storage path in the S3 bucket.
  • ?region={region}&access-key={accessKey}&secret-key={secretKey}: the region, AccessKey ID, and AccessKey secret.

Supported parameters:

Parameter Value required? Description Supported storage scheme Supported version
endpoint Yes The endpoint of the region where the OSS host resides. OSS V4.2.0
region Yes The region where the S3 bucket resides. S3 V4.2.0
storage-class Yes The storage class of Amazon S3. S3 V4.2.0
access-key Yes The AccessKey ID used to access the bucket. OSS/S3 V4.2.0
secret-key Yes The AccessKey secret used to access the bucket. OSS/S3 V4.2.0

Notice

  • When you export database object definitions and table data to Alibaba Cloud OSS, the `endpoint`, `access-key`, and `secret-key` parameters are required.
  • When you export database object definitions and table data to Amazon S3, the `region`, `access-key`, and `secret-key` parameters are required.
  • When you use the `endpoint` option in combination with -f and --file-name, take note of the following:
    • Both the -f and `endpoint` options are required.
    • Regardless of whether the --file-name option is specified, the -f option is no longer associated with the key of the uploaded file in the bucket.
    • If the --file-name option is specified but the path is not specified, the endpoint is used and concatenated with an extension, for example, `data/{schema}/table`.
    • If the --file-name option is not specified, the endpoint is used and concatenated with an extension, for example, `data/{schema}/table`.
  • --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 MySQL mode and the yyyy-MM-dd HH:mm:ss format in Oracle mode.

    Note

    • This option can be used only in combination with the --cut or --csv option.
    • In MySQL mode of OceanBase Database, you cannot set a format for the DATE data type if the 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 MySQL mode of OceanBase Database. The precision is the same as that in the table definition.

    Note

    • This option can be used only in combination with the --cut or --csv option.
    • In MySQL mode of OceanBase Database, you cannot set a format for the TIME data type if the 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 MySQL mode of OceanBase Database. The precision is the same as that in the table definition.

    Note

    • This option can be used only in combination with the --cut or --csv option.
    • In MySQL mode of OceanBase Database, you cannot set a format for the DATETIME data type if the 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 MySQL and Oracle modes of OceanBase Database. The precision is the same as that in the table definition.

    Note

    • This option can be used only in combination with the --cut or --csv option.
    • In MySQL mode of OceanBase Database, you cannot set a format for the TIMESTAMP data type if the 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 Oracle mode of OceanBase Database. The precision is the same as that in the table definition.

    Note

    This option can be used only in combination with the --cut or --csv 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 Oracle mode of OceanBase Database. The precision is the same as that in the table definition.

    Note

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

  • --exclude-virtual-columns

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

  • --character-set ' character_set_string '

    The character set used when you create a database connection. Default value: the value of the jdbc.url.character.encoding session variable in the session.properties file. The character set specified by the --character-set option will overwrite the value of jdbc.url.character.encoding. Valid values: binary, gbk, gb18030, utf16, and utf8mb4.

  • --preserve-zero-datetime

    Specifies whether to reserve the original format of zero values of the DATE and TIME types. If this option is specified, NULL values of DATE and TIME types with a NOT NULL constraint are exported as 0, and NULL values of nullable columns are still exported as NULL.

Performance options

  • --page-size int_num

    The page size. This option is used in OBDUMPER V4.0.0 and later versions. Default value: 1000000.

  • --thread int_num

    The number of concurrent export threads allowed. This option corresponds to the number of export threads. Default value: Number of CPU cores x 2. 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 int_num

    The block size for a file to be exported. If the size of the data file to be exported exceeds the value of this option, the file will be split into logical sub-files. When specifying this option, you do not need to explicitly specify the unit. The default unit is MB. Default value: 1024 MB. 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 256MB indicates that the size of a file cannot exceed 256 MB, and --block-size 256ROW indicates that the size of a file cannot exceed 256 rows.

  • --parallel-macro int_num

    The number of macroblocks that can be processed by each export thread. Default value: 8.

Other options

  • -H, --help

    Specifies to show the help information of the tool.

  • -V, --version

    Specifies to show the version of the tool.

Previous topic

OBDUMPER overview
Last

Next topic

Define control files
Next
What is on this page
Options
Connection options
Feature options
Performance options
Other options