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

  • Document Overview
  • Introduction
  • Preparations
    • Prepare the environment
    • Download OBLOADER & OBDUMPER
  • User Guide (OBLOADER)
    • Quick start
    • Command-line options
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • Error handling
    • direct load
    • 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.2.8
        • OBLOADER & OBDUMPER V4.2.7
        • OBLOADER & OBDUMPER V4.2.6
        • OBLOADER & OBDUMPER V4.2.5
        • OBLOADER & OBDUMPER V4.2.4
        • OBLOADER & OBDUMPER V4.2.1
        • OBLOADER \& OBDUMPER V4.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 Prepare the environment Download OBLOADER & OBDUMPER Quick start Command-line optionsDefine control filesPreprocessing functionsCase expressionsPerformance tuning Error handling direct loadFAQ Quick start Command-line optionsDefine control filesPreprocessing functionsCase expressions Performance tuningFAQ 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.8
iconOceanBase Loader and Dumper
V 4.2.8
  • 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

Command-line options

Last Updated:2026-04-13 05:55: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
Features
Performance options
Other options
Options

folded

share

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

Overview

Option styles

OBLOADER supports the Unix and GNU styles of command-line options.

  • 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 OBLOADER are classified into basic options and advanced options.

  • Basic options: general options of OBLOADER, 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: feature options (such as the timestamp format, allowlist- and blocklist-based table/column filtering settings, and error handling method), performance options, and other options.

Required options

When using OBLOADER to import data, you must include at least the following options: connection options, format options, database object type options, and storage path options.

Example statement:

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

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

Basic options

Connection options

OBLOADER needs to connect to OceanBase Database to read and write data. You can specify the following options to connect to OceanBase Database.

Import types

Import type Related command-line options
OceanBase Database
  • -h host_name, --host= host_name
    The IP address of the host that connects to the physical node of OceanBase Database.
  • -P port_num, --port= port_num
    The port number of the host that connects to the physical node of OceanBase Database.
  • -u,--user
    The username, tenant name, and cluster name for connecting to the target database. Format: <user>@<tenant>#<cluster>. Example: -u user@tenant#cluster.
    • If the specified username is incorrect, OBLOADER cannot connect to the database.
    • If the cluster name is not specified in the command line, it indicates that the current connection is to the physical node of the database, and the related options (such as -h/-P) specify the IP address and port of the physical node of the database. If the cluster name is specified in the command line, it indicates that the current connection is to the ODP service, and the related options (such as -h/-P) specify the IP address and port of the ODP service.
  • -D database_name, --database= database_name
    Specifies the database to which database object definitions and table data are imported.
  • -p ' password', --password='password'
    The password of the account for connecting to OceanBase Database. If this option is not specified in the command line, it indicates that the current database account does not have a password. If this option is specified in the command line, single quotation marks must be added before and after the parameter value. Example: -p'******'.

    Note

    In Windows, double quotation marks must be added before and after the parameter value. If the parameter value of other options is a string, double quotation marks must also be added before and after it.

  • --sys-user sys_username
    The username of a user in the sys tenant that has specific privileges. For example, the root user or proxyro user. OBLOADER needs to query metadata from system tables in the sys tenant. Default value: root. This option is not required for OceanBase Database 4.0.0 and later versions.
  • --sys-password 'sys_password'
    The password of an account in the sys tenant that has specific privileges. This option is used with the --sys-user option. By default, the password of the root user in the sys tenant is empty. If this option is specified in the command line, single quotation marks must be added before and after the parameter value. Example: --sys-password '******'. This option is not required for OceanBase Database 4.0.0 and later versions.

    Note

    If this option is not specified, OBLOADER cannot query metadata from system tables, which will greatly affect the import functionality and performance.

  • --no-sys
    Indicates that the user cannot provide the password of the sys tenant in the OceanBase Database environment and that database objects or table data are imported from an OceanBase cluster deployed in the OceanBase Database environment. The difference between this option and the --public-cloud option is that when you use this option, you must specify the tenant name in the command line ( -u <user>@<tenant>), and you must also specify the cluster name when you connect to the ODP service ( -u <user>@<tenant>#<cluster>). In OceanBase Database versions earlier than 4.0.0, if you do not specify the --public-cloud or --no-sys option, you must specify the --sys-user and --sys-password options.
Cloud OceanBase Database --public-cloud
Indicates that database objects or table data are imported from an OceanBase cluster deployed in a cloud database. If you specify this option in the command line, you do not need to specify the tenant name and cluster name in the connection option ( -u <user>@<tenant>#<cluster>). In this case, the import program automatically opens the --no-sys option. For more information about the --no-sys option, see the corresponding option description. Using the --public-cloud or --no-sys option will affect the import functionality, performance, and stability. OceanBase Database 2.2.30 and later versions support the server-side throttling feature. To ensure data import stability, you can set the server-side throttling threshold by using the following commands:
alter system set freeze_trigger_percentage=50;
alter system set minor_merge_concurrence=64;
alter system set writing_throttling_trigger_percentage=80 tenant='xxx';
ODP (Sharding) logical database
  • -h host_name, --host= host_name
    The IP address of the host that connects to the ODP service.
  • -P port_num, --port= port_num
    The port number of the host that connects to the ODP service.
  • --logical-database
    Indicates that the import is performed from an ODP (Sharding) logical database. If you specify the --logical-database option in the command line, the exported physical shard schema cannot be directly imported to the database. You need to manually convert the physical shard schema to a logical shard schema before you can import it to the database for business use.

Direct load

OBLOADER 4.2.6 and later support direct load.

  • --rpc-port= rpc_port_num

    Specifies the port number of the OBServer RPC endpoint. This option is used in conjunction with --direct and --parallel to indicate that data is imported in direct load mode by connecting to the OBServer RPC endpoint.

    Note

    • This option is applicable only to OceanBase Database 4.2.0 RC2 and later.
    • Obtain the OBServer RPC endpoint as follows:
      • When connecting to the ODP service endpoint:
        • In an OceanBase Database environment, the ODP RPC port is 3307 by default.
        • In an OceanBase Database environment, the default port is 2885. If you need to customize the port, you can specify it using the -s option when you start ODP.
      • When connecting to the OBServer service endpoint, you can query the DBA_OB_SERVERS system view in the sys tenant to obtain the OBServer RPC endpoint, which is 2882 by default.
  • --direct

    Specifies direct load mode. This option is used in conjunction with --rpc-port and --parallel.

    Note

    • OBLOADER does not support binary data types in direct load mode.
    • OBLOADER supports direct load mode for connecting to OBServer and ODP. The corresponding version requirements are as follows:
      • When connecting to OBServer: the OBServer version must be 4.2.0 or later.
      • When connecting to ODP: the ODP version must be 4.1.3 or later, and the OBServer version must be 4.2.1 or later.
  • --parallel= parallel_num

    Specifies the parallelism for data loading in direct load mode. This option is used in conjunction with --rpc-port and --direct.

Feature options

File formats

Format (CLI option) Related CLI options Scenarios
--csv
Specifies the CSV format.
  • --skip-header
    Skips the header row of the CSV file, which contains the field names.
  • --column-delimiter 'column_delimiter_char'
    Specifies the string delimiter.
  • --line-separator 'line_separator_string'
    Specifies the line separator string.
  • --escape-character 'escape_char'
    Specifies the escape character.
  • --column-separator 'column_separator_char'
    Specifies the column separator string. The default value is a comma (,).
  • --with-trim
    Removes the spaces at the beginning and end of the data.
  • --ignore-unhex
    Specifies whether to ignore decoding of hexadecimal strings. This option applies only to binary data types.
  • --character-set 'character_set_string'
    Specifies the character set for the database connection.
  • --null-string 'null_replacer_string'
    Specifies that the column value will be treated as NULL when it is the same as the specified character. For example, if the column value is test and you use the --null-string test option, the column will be imported as NULL.
  • --empty-string 'empty_replacer_string'
    Specifies that the specified character will be replaced with an empty character (space). The default value is \E.
  • --file-suffix 'suffix_name'
    Specifies the file suffix for the data file during import.
  • --file-encoding 'encode_name'
    Specifies the file encoding used to read the data file. This encoding is not the database encoding.
Applies to almost all scenarios.
--cut
Specifies the CUT format.
  • --skip-header
    Skips the header row of the CUT file, which contains the field names.
  • --skip-footer
    Skips the last row of the CUT file.
  • --column-splitter 'split_string'
    Specifies the column separator string.
  • --trail-delimiter
    Specifies whether the data row ends with a delimiter.
  • --line-separator 'line_separator_string'
    Specifies the line separator string.
  • --with-trim
    Removes the spaces at the beginning and end of the data.
  • --ignore-escape
    Specifies whether to ignore escaping of characters during import of CUT files. By default, escaping is not ignored.
  • --ignore-unhex
    Specifies whether to ignore decoding of hexadecimal strings. This option applies only to binary data types.
  • --character-set 'character_set_string'
    Specifies the character set for the database connection.
  • --null-string 'null_replacer_string'
    Specifies that the column value will be treated as NULL when it is the same as the specified character. For example, if the column value is test and you use the --null-string test option, the column will be imported as NULL.
  • --escape-character 'escape_char'
    Specifies the escape character.
  • --empty-string 'empty_replacer_string'
    Specifies that the specified character will be replaced with an empty character (space). The default value is \E.
  • --file-suffix 'suffix_name'
    Specifies the file suffix for the data file during import.
  • --file-encoding 'encode_name'
    Specifies the file encoding used to read the data file. This encoding is not the database encoding.
Similar to CSV.
Commonly used to import data from older platforms that export flexible data exchange formats.
--pos
Specifies the POS format.
Must be used with a control file. Used to interact with unload platforms that only support fixed-length formats.
--sql
Specifies the SQL format.
  • --line-separator 'line_separator_string'
    Specifies the line separator string.
  • --ignore-unhex
    Specifies whether to ignore decoding of hexadecimal strings. This option applies only to binary data types.
  • --character-set 'character_set_string'
    Specifies the character set for the database connection.
  • --null-string 'null_replacer_string'
    Specifies that the column value will be treated as NULL when it is the same as the specified character. For example, if the column value is test and you use the --null-string test option, the column will be imported as NULL.
  • --file-suffix 'suffix_name'
    Specifies the file suffix for the data file during import.
  • --file-encoding 'encode_name'
    Specifies the file encoding used to read the data file. This encoding is not the database encoding.
Applies to scenarios where only data is imported, not the schema. Supports only one SQL syntax, but performs well.
--mix
Specifies the MIX format.
  • --character-set 'character_set_string'
    Specifies the character set for the database connection.
  • --file-suffix 'suffix_name'
    Specifies the file suffix for the data file during import.
  • --file-encoding 'encode_name'
    Specifies the file encoding used to read the data file. This encoding is not the database encoding.
  • --compat-mode
    Imports the MySQL table schema definition in compatibility mode.
Applies to importing SQL files of any format. Offers better compatibility, but performs slower than --sql.
The current implementation reads all text into memory before parsing, which is not suitable for large files.
--par
Used to specify the Parquet data file to be imported.
  • --character-set 'character_set_string'
    Used to specify the character set for the database connection.
  • --ignore-unhex
    Used to specify whether to ignore decoding of hexadecimal strings. This option is applicable only to binary data types.
  • --file-suffix 'suffix_name'
    Used to specify the suffix of the data file when importing data.
  • --file-encoding 'encode_name'
    Used to specify the file encoding for reading the data file, which is different from the database encoding.
Data migration from Hive, Spark, or other data sources that can export standard Parquet files.
--orc
Used to specify the ORC data file to be imported.
  • --character-set 'character_set_string'
    Used to specify the character set for the database connection.
  • --ignore-unhex
    Used to specify whether to ignore decoding of hexadecimal strings. This option is applicable only to binary data types.
  • --file-suffix 'suffix_name'
    Used to specify the suffix of the data file when importing data.
  • --file-encoding 'encode_name'
    Used to specify the file encoding for reading the data file, which is different from the database encoding.
Data migration from Hive, Spark, or other data sources that can export standard ORC files.
--ddl
Used to specify the DDL file to be imported.
Parallel DDL import is supported in OceanBase Database V4.2.1 and later.
  • --character-set 'character_set_string'
    Used to specify the character set for the database connection.
  • --ignore-unhex
    Used to specify whether to ignore decoding of hexadecimal strings. This option is applicable only to binary data types.
  • --file-suffix 'suffix_name'
    Used to specify the suffix of the data file when importing data.
  • --file-encoding 'encode_name'
    Used to specify the file encoding for reading the data file, which is different from the database encoding.
Logical backup.

Note

For more information about the command-line options, see the Options section in this topic.

Database object types

  • --all

    This option is used to import all supported database object definitions and table data. When used with --ddl, it indicates importing all database object definition files. When used with --csv, --sql, --cut, or --pos, it indicates importing all corresponding data files. To import all database object definitions and table data, you can specify the --all option with any data format option.

    Note

    The --all option is mutually exclusive with any other database object option. If both --all and another database object option are specified, the --all option takes precedence.

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

    This option is used to import table group definitions. Except for not supporting data import, the description is the same as that of the --table option.

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

    This option is used to import table definitions or table data. When used with --ddl, it indicates importing only table definitions. When used with any data format option, it indicates importing only table data. If multiple tables are specified, separate the table names with commas (,). By default, table names in OceanBase Database in Oracle mode are imported in uppercase, and table names in OceanBase Database in MySQL mode are imported in lowercase. For example, in OceanBase Database in Oracle mode, --table 'test' and --table 'TEST' both indicate the TEST table. In OceanBase Database in MySQL mode, --table 'test' and --table 'TEST' both indicate the test table. If you want to distinguish between uppercase and lowercase, enclose the table name in brackets ([ ]). For example, --table '[test]' indicates the test table, and --table '[TEST]' indicates the TEST table. If the table name is specified as an asterisk (*), it indicates importing all table definitions or table data.

    Notice

    If you use a control file for import, the case of the table names specified by --table must match the case in the database. Otherwise, the control file will not take effect.

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

    This option is used to import view definitions. Except for not supporting data import, the description is the same as that of the --table option.

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

    This option is used to import trigger definitions. Except for not supporting data import, the description is the same as that of the --table option.

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

    This option is used to import sequence definitions. Except for not supporting data import, the description is the same as that of the --table option. This option is applicable only to OceanBase Database in Oracle mode.

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

    This option is used to import synonym definitions. Except for not supporting data import, the description is the same as that of the --table option. This option is applicable only to OceanBase Database in Oracle mode.

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

    This option is used to import type definitions. Except for not supporting data import, the description is the same as that of the --table option. This option is applicable only to OceanBase Database in Oracle mode.

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

    This option is used to import type body definitions. Except for not supporting data import, the description is the same as that of the --table option. This option is applicable only to OceanBase Database in Oracle mode.

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

    This option is used to import package definitions. Except for not supporting data import, the description is the same as that of the --table option. This option is applicable only to OceanBase Database in Oracle mode.

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

    This option is used to import package body definitions. Except for not supporting data import, the description is the same as that of the --table option. This option is applicable only to OceanBase Database in Oracle mode.

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

    This option is used to import function definitions. Except for not supporting data import, the description is the same as that of the --table option.

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

    This option is used to import stored procedure definitions. Except for not supporting data import, the description is the same as that of the --table option.

File path

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

    Specifies the absolute path of the local disk where the data file is stored. When you import data files from Aliyun OSS, you must specify the -f option to save the generated logs and binary files.

  • --storage-uri 'storage_uri_string'

    Specifies the uniform resource locator (URL) of the storage. OBLOADER 4.2.0 and later versions support importing database object definitions and table data from Aliyun OSS or Amazon S3. OBLOADER 4.2.1 and later versions support importing database object definitions and table data from Hadoop.

    The syntax of 'storage_uri_string' is as follows:

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

    The following table describes the components of the URL.

    Component Description
    scheme The storage type. Valid values: Aliyun OSS, Amazon S3, and Hadoop.
    If the specified scheme is not supported, an error is returned.
    host The name of the storage space.
    • When you import data from OSS or S3, the host indicates the bucket. For more information, see OSS Bucket.
    • When you import data from Apache Hadoop, the host indicates the Hadoop node. The format is either <ip>:<port> or <cluster_name>.
    path The resource path of the data to be imported from the storage space. The path** must** start with /.
    parameters The parameters required for the request.
    Each parameter can be a key or a key-value pair.

    Example: Import data from S3

    --storage-uri 's3://bucket/path?region={region}&access-key={accessKey}&secret-key={secretKey}'
    
    • s3: the scheme is s3.
    • bucket: the name of the S3 storage space.
    • path: the resource path of the data to be imported from S3.
    • ?region={region}&access-key={accessKey}&secret-key={secretKey}: the values of the region, access-key, and secret-key parameters.

    Supported parameters:

    Parameter Whether a value is required Description Supported storage type Supported version
    endpoint Yes
    • Specifies the endpoint of the OSS host.
    • Specifies the domain name endpoint for accessing S3.
    • OSS
    • S3
    • 4.2.0
    • 4.2.5
    region Yes Specifies the terminal node, which is the physical location of the S3 bucket. S3 4.2.0
    storage-class Yes Specifies the Amazon S3 storage class. S3 4.2.0
    access-key Yes Specifies the access account for the storage. OSS/S3 4.2.0
    secret-key Yes Specifies the access key for the storage. OSS/S3 4.2.0
    hdfs-site-file Yes Specifies the hdfsSiteFile configuration file, which contains the Apache Hadoop configuration information for setting the storage and access rules of Apache Hadoop, such as the block size and the number of replicas. Apache Hadoop 4.2.1
    core-site-file Yes Specifies the hdfsSiteFile configuration file, which contains the core configuration information of the Hadoop cluster, such as the URI and default file system of the Apache Hadoop file system. Apache Hadoop 4.2.1
    principal Yes Specifies the Kerberos authentication identifier. Apache Hadoop 4.2.1
    keytab-file Yes Specifies the absolute path of the Keytab file for authorizing users or services to access the system resources. Apache Hadoop 4.2.1
    krb5-conf-file Yes Specifies the Kerberos configuration file path. Apache Hadoop 4.2.1

    Note

    • When you import database object definitions and table data from Aliyun OSS, you must specify the endpoint, access-key, and secret-key parameters.
    • When you import database object definitions and table data from Amazon S3, you must specify the region, access-key, and secret-key parameters.
  • --ctl-path 'control_path'

    Specifies the absolute path of the local disk where the control file is stored. You can configure built-in processing functions in the control file. Before data is imported, the configured functions are used to preprocess the data. For example, you can convert the case of a string or determine whether a string is empty. For more information about the control file, see Data Processing. When you specify this option in the command line, you must enclose the parameter value in single quotation marks. For example: --ctl-path '/home/controls/'.

  • --log-path 'log_path'

    Specifies the output directory of the OBLOADER running logs. If you do not specify this option, the running logs of OBLOADER are output to the directory specified by the -f option. In most cases, you do not need to use redirection to output the logs.

Other options

  • -H, --help

    Displays the help for the CLI tool.

  • -V, --version

    Displays the version number of the current tool.

Advanced options

Features

Timestamp format

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

    Specifies the date format for the database connection in OceanBase Database's Oracle mode. Default value: YYYY-MM-DD HH24:MI:SS.

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

    Specifies the timestamp format for the database connection in OceanBase Database's Oracle mode. Default value: YYYY-MM-DD HH24:MI:SS:FF9.

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

    Specifies the timestamp format with timezone for the database connection in OceanBase Database's Oracle mode. Default value: YYYY-MM-DD HH24:MI:SS:FF9 TZR.

Allowlist- and blocklist-based filtering

  • Table-level filtering

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

      Specifies the tables to exclude when importing table definitions or data. Table names support pattern matching. Example: --exclude-table 'test1,test*,*test,te*st' This parameter excludes the following tables when importing table definitions or data:

      • test1

      • All tables whose names start with test

      • All tables whose names end with test

      • All tables whose names start with te and end with st

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

      Specifies the data types to exclude when importing data.

    • --file-regular-expression

      Specifies the regular expression to use when importing a single table file. This option is applicable only to single-table imports. Example: --file-regular-expression ".*" matches all files in the directory using the ".*" regular expression, where * matches zero or more arbitrary characters. Another example: --file-regular-expression ".*\\.csv" matches files ending with ".csv" using the ".*\.csv" regular expression, where "\." matches the actual period character ".".

  • Column-level filtering

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

      Specifies the column names to exclude when importing data.

      Notice

      • The specified column names must match the case of the column names in the table structure.
      • In the imported data file, the excluded columns do not have corresponding data, and the order of the imported columns must match the order of the columns in the table.

Error handling

  • --max-discards int_num

    Specifies the maximum number of duplicate records allowed per table. If the number of duplicate records in any table exceeds this limit, the import for that table is stopped, and the table is marked as failed in the log. Other tables are not affected. Default value: -1, which means to ignore duplicate records and continue the import.

    Note

    This option takes effect only if the table contains a primary key or a unique key.

  • --retry

    Specifies whether to retry the import task from the point of interruption. Recommendation: If the imported data volume exceeds 80%, use this option for resuming the import to avoid re-importing (which may result in a small number of duplicate records). If the imported data volume is not significant, consider clearing the table and starting the import again for better efficiency.

    Notice

    • The load.ckpt file is a checkpoint file generated during the tool's runtime, located in the directory specified by -f. If the load.ckpt file does not exist, this option cannot be used.
    • This option is not applicable to direct load imports.
  • --max-errors int_num

    Specifies the maximum number of errors allowed per table during import. If the number of errors in any table exceeds this limit, the import for that table is stopped, and the table is marked as failed in the log. The optional values are 0, -1, and a positive integer N. If the value is set to -1, it means to ignore errors and continue the import. Default value: 1000.

  • --strict= 'strict_string'

    Specifies whether to terminate the process upon encountering bad or discarded records during import. Default value: true, which means to terminate the process (System exit 1) if bad or discarded records are found in the imported data. false means to not affect the process's exit status (System exit 0) even if bad or discarded records are found.

    Note

    This option can be used with --max-discards or --max-errors to skip errors when the number of duplicates or errors is within the specified range. For more information, see Error handling.

  • --replace-data

    Specifies whether to replace duplicate data in the table. This option is applicable only to tables with a defined primary key or unique key (including non-null fields). If a large amount of duplicate data (more than 30% of the total data) exists in the file, it is recommended to clear the table and re-import the data. Data replacement is less efficient than importing to an empty table. This option is effective only when used with --csv, --sql, or --cut. It does not take effect with the --ddl option.

    Notice

    • If duplicate data exists in the file or table, the data in the table will be replaced with the data in the file.
    • For tables without a primary key or unique key, this option appends data to the table.
    • If you do not need to replace duplicate data, do not specify this option in the command line to avoid affecting your business operations.

Performance options

  • --rw float_num

    Specifies the proportion of file parsing threads to the total number of threads. Default value: 1. When used with the --thread option, the number of file parsing threads is calculated as --thread value * --rw value.

  • --slow float_num

    Specifies the threshold for entering slow import mode. When OceanBase memory usage reaches 75%, OBLOADER automatically slows down to prevent continuous memory usage spikes. Default value: 0.75.

  • --pause float_num

    Specifies the threshold for entering pause mode. When OceanBase memory usage reaches 85%, OBLOADER automatically stops importing to prevent high memory levels. Default value: 0.85.

  • --batch int_num

    Specifies the size of batch writes. It is recommended to set this option inversely proportional to the table width, but avoid setting it too high to prevent database memory overflow. Default value: 200.

    Note

    OBLOADER 4.2.0 and later versions support adaptive --batch default values based on the Java Virtual Machine's memory.

  • --thread int_num

    Specifies the number of concurrent threads. This option directly corresponds to the number of write threads. When used with the --rw option, it calculates the number of file parsing threads using the formula: --thread value * --rw value. The default value is CPU * 2, with a maximum of 32 if the CPU count exceeds 16.

    Note

    OceanBase Database V4.2.1 and later versions support parallel DDL import. When importing database object definitions from versions earlier than V4.2.1, you do not need to specify this option.

  • --block-size

    Specifies the threshold for splitting file blocks, supporting LONG data types. For example, --block-size 64 indicates that a single file should not exceed 64MB. The unit is MB by default, with a default value of 64. By default, OBLOADER automatically splits large files into multiple logical subfiles of 64MB each, without occupying additional storage space.

  • --max-tps int_num

    Specifies the maximum import TPS. Specifying this option ensures a stable import rate.

  • --max-wait-timeout int_num

    Specifies the maximum waiting time for OceanBase server-side compaction. The unit is hours by default. When the OceanBase server is in a compaction state, the client enters pause mode, and the maximum waiting time cannot exceed the value specified by this option. Default value: 3.

Other options

  • --truncate-table

    Specifies whether to truncate tables in the target database before importing data. This option is only applicable when used with any data format option. When used with --all or --table '*', it truncates all tables in the database. If only specific tables need to be truncated, you can explicitly specify --table 'test1,test2,[....]'. When used with the --with-data-files option, it truncates only tables that have corresponding data files.

    Notice

    • When using --all or --table '*' with --truncate-table, the program will truncate all tables in the target database, even if there are no corresponding data files in the directory specified by the -f option.
    • Do not use this option to truncate tables in the target database or target tables. It is strongly recommended to manually truncate tables based on business needs to avoid affecting operations.
  • --with-data-files

    When used with the --truncate-table or --delete-from-table option, it specifies truncating or clearing only tables that have corresponding data files. Specifying this option alone has no effect.

  • --delete-from-table

    Specifies whether to delete all data from tables in the target database before importing data. This option is only applicable when used with any data format option. When used with --all or --table '*', it deletes all data from all tables in the database. If only specific tables need to be cleared, you can explicitly specify --table 'test1,test2,[....]'. When used with the --with-data-files option, it deletes only data from tables that have corresponding data files.

    Notice

    • When using --all or --table '*' with --delete-from-table, the program will delete all data from all tables in the target database, even if there are no corresponding data files in the directory specified by the -f option.
    • Do not use this option to delete data from the target database or target tables, especially large tables. It is strongly recommended to manually delete data based on business needs to avoid affecting operations.
  • --replace-object

    Specifies whether to replace existing database object definitions when importing database object definitions. For tables and synonyms, it uses a delete-and-create approach. For functions and stored procedures, it uses CREATE OR REPLACE. This option is only applicable when used with the --ddl or --mix option and does not affect other data format options like --csv or --sql.

    Notice

    • If an object already exists in the target database, it will be forcibly replaced with the object definition saved in the file.
    • If you do not need to replace database objects, do not use this option to avoid affecting operations.
  • --session-config

    Specifies the connection configuration file. A default configuration file is provided in the package: <tool_root_directory>/conf/session.config.json. You do not need to configure it separately. It is recommended to specify this option only when you need to use the same package to load multiple connection configurations.

  • --external-data

    Specifies whether the imported dataset was exported by a third-party tool. When OBDUMPER exports data, it generates a MANIFEST.bin file in the directory specified by the -f option to save metadata. OBLOADER imports data by default, parsing this metadata file. If the file is missing or the data was exported by a third-party tool without a metadata file, you can specify this option to skip metadata parsing during import.

Options

Option Required Description Introduced in Deprecated
-h(--host) Yes The IP address of the host where the ODP or OceanBase physical node is located.
-P(--port) Yes The port of the host where the ODP or OceanBase physical node is located.
--rpc-port No The port of the OBServer RPC service. 4.2.5
--compat-mode No Specifies the compatibility mode for importing MySQL table definitions.
When you import MySQL table definitions, OBLOADER converts the native CREATE TABLE statements of MySQL into equivalent statements supported by OceanBase Database in MySQL mode.

Notice

  • Only MySQL table definitions can be imported.
  • MySQL 5.6, 5.7, and 8.0 are supported.
4.2.7
--direct No Specifies the direct import mode. 4.2.5
--parallel No Specifies the degree of parallelism for data loading in direct import mode. 4.2.6
-u(--user) Yes The username, tenant name, and cluster name. Format: <user>@<tenant>#<cluster>.
-p(--password) No The password.
-D(--database) No The database name.
-f(--file-path) Yes The directory where the data file is stored or the absolute path of the data file.
--sys-user No The username of the sys tenant.
--sys-password No The password of the sys tenant.
--public-cloud No The running environment of OceanBase Cloud.
--file-suffix No The suffix of the data file.
Typically, the suffix of a file is related to its format. For example, a CSV file is usually named xxx.csv. If you do not strictly follow the naming convention, you can name a CSV file xxx.txt. In this case, OBLOADER cannot identify the file based on the format. This option is optional. Each data format has a default suffix. By default, the suffix of a CSV file is .csv, the suffix of an SQL file is .sql, the suffix of a CUT file is .dat, and the suffix of a POS file is .dat. When you specify this option in the CLI, enclose the parameter value in single quotation marks. For example: --file-suffix '.txt'.
--file-encoding No The file encoding. (This is different from the database encoding.)
When you specify this option in the CLI, enclose the parameter value in single quotation marks. For example: --file-encoding 'GBK'. Default value: UTF-8.
--ctl-path No The directory where the control file is stored.
--log-path No The output directory of the log file.
--ddl No Specifies the DDL file.
A DDL file is a database object definition file. The naming convention is object name-schema.sql. When you specify this option in the CLI, only database object definitions are imported, and table data is not imported.

Notice

Avoid comments and switch statements in the file. If database objects depend on each other, the import may fail. In this case, you must manually intervene.

--csv No Specifies the CSV file. (Recommended)
A CSV file stores data in the standard CSV format. The naming convention is table name.csv. For more information about the CSV format, see RFC 4180. The delimiter is the most likely to cause errors in the CSV format. The commonly used delimiters are single quotation marks and double quotation marks. If the data contains delimiters, you must specify an escape character to escape the delimiters. Otherwise, OBLOADER cannot parse the data correctly. We recommend that you use the CSV format. We recommend that you use this option with the --table option. If you use this option with the --all option, OBLOADER imports only the data files corresponding to the tables, but not the database object definitions.
--sql No Import data files in SQL format. (Different from DDL files)
SQL files store data in INSERT statements. The file name must be in the format table_name.sql. Each row of data corresponds to an executable INSERT statement. SQL files differ from DDL files in content format. We recommend that you use this option with the --table option. If you use this option with the --all option, OBLOADER imports only the data files corresponding to the tables, and does not import the definitions of database objects.

Notice

SQL files cannot contain SQL functions, special characters, or line breaks. Otherwise, the files may not be parsed correctly.

--orc No Import data files in ORC format.
ORC files store data in columnar format. The file name must be in the format table_name.orc. For more information, see Apache ORC.
4.0.0
--par No Import data files in Parquet format.
Parquet files store data in columnar format. The file name must be in the format table_name.parquet. For more information, see Apache Parquet.

Note

When you use OBLOADER 4.2.5 or earlier to import a Parquet file, the DECIMAL, DATE, TIME, and TIMESTAMP data types are not supported.

4.0.0
--mix No Import a file that contains both definitions and data.
A MIX file contains DDL and DML statements. The file name must be in the format table_name.mix.

Notice

A MIX file does not have a strict format. It is complex and has poor performance. We recommend that you do not use it.

--pos No Import data files in POS format.
POS files store data in fixed-length byte format. The file name must be in the format table_name.dat. Fixed-length byte format stores each column of data in a fixed-length byte sequence. If the length is insufficient, spaces are added. If the length is exceeded, the data is truncated at the byte level, which may cause garbled characters. We recommend that you use this option with the --table option. If you use this option with the --all option, OBLOADER imports only the data files corresponding to the tables, and does not import the definitions of database objects. (Different from fixed-length character format).
--cut No Import data files in CUT format.
CUT files store data in a format where data is separated by single characters or strings. The file name must be in the format table_name.dat. How do I distinguish CUT files from CSV files? CSV files separate fields by single characters, commonly commas. CUT files separate fields by strings. For example, fields are separated by the \|@\| string. CSV files use single or double quotation marks as delimiters. CUT files do not use delimiters. We recommend that you use this option with the --table option. If you use this option with the --all option, OBLOADER imports only the data files corresponding to the tables, and does not import the definitions of database objects.

Notice

CUT files store data in full rows. If the field separator is a single character, avoid special characters such as separators, carriage returns, or line breaks in the data. Otherwise, OBLOADER cannot correctly parse the data.
When you specify the --cut option to import data, do not use the --trail-delimiter option if the file does not contain a field separator (or string) at the end of each data row. Otherwise, the import program will encounter a serious error.

--all No Import the definitions of all supported database objects and the data of all tables.
--table-group No Import the definition of a table group. 3.1.0
--table No Import the definition of a table or the data of a table.
--view No Import the definition of a view.
--trigger No Import the definition of a trigger.
--sequence No Import the definition of a sequence.
--synonym No Import the definition of a synonym.
--type No Import the definition of a type. 4.0.0
--type-body No Import the definition of a type body.
--package No Import the definition of a package.
--package-body No Import the definition of a package body.
--function No Import the definition of a function.
--procedure No Import the definition of a stored procedure.
--replace-object No Indicates whether to replace the definition of an existing object. (Not recommended. We recommend that you manually replace the definition.)
--rw No Specifies the proportion of threads for parsing data files.
--slow No Specifies the threshold for triggering a slow import.
--pause No Specifies the threshold for triggering a stop of an import.
--batch No Specifies the number of records in each transaction batch.
--thread No Specifies the number of concurrent threads for an import task.
--block-size No Specifies the file split size.
--retry No Specifies whether to restart an import from the last save point.
--external-data No Indicates whether the data file is exported by a third-party tool, and skips the metadata file check.
--max-tps No Specifies the import throttling threshold. The default unit is rows per second.
--max-wait-timeout No Specifies the maximum wait time for a database major compaction.
--nls-date-format No Sets the session-level date and time format. (Supported only in OceanBase Database Oracle mode.)
--nls-timestamp-format No Sets the session-level timestamp format. (Supported only in OceanBase Database Oracle mode.)
--nls-timestamp-tz-format No Sets the session-level timestamp with time zone format. (Supported only in OceanBase Database Oracle mode.)
--trail-delimiter No Removes the last column delimiter at the end of each row.
--with-trim No Removes leading and trailing spaces in data.
--skip-header No Skips the first row of a CSV or CUT file. This option is supported only in OceanBase Database 3.3.0 and later.
--skip-footer No Skips the last row of a CUT file during import. 3.3.0
--null-string No Indicates whether to treat a column value as NULL when the value is the same as the specified character. The default value is \N.
--empty-string No Specifies a character to replace with an empty character (space). The default value is \E.
--line-separator No Specifies the line separator. During import of a CUT file, you can customize the line separator. The default value is \n.
During import of a CUT file, you can customize the newline character in the data file. The default value of this option depends on the system platform. Valid values: \r, \n, and \r\n.
--column-separator No Specifies the column separator. (Different from the column separator string in CUT files.)
--escape-character No Specifies the escape character. This option supports only a single character. The default value is \.

Note

You can specify a special (invisible) character as the escape character. The specified character must be represented in hexadecimal.

--column-delimiter No Specifies the string delimiter. This option supports only a single character and can be used only with the --csv option. The default value is a single quotation mark (').
--ignore-unhex No Ignores the decoding of hexadecimal strings.
--exclude-table No Ignores the import of the specified table definition and table data.
--exclude-data-types No Skips the import of data of the specified data types.
--column-splitter No Specifies the column separator string. (Different from the column separator in CSV files.)
--max-discards No Specifies the maximum number of duplicate records for a single table during import. The default value is -1.
--max-errors No Specifies the maximum number of errors allowed for a single table during import. The default value is 1000.
--exclude-column-names No Excludes data corresponding to the specified column names during import.
--replace-data No Specifies whether to replace duplicate data. This option is applicable only to tables with primary keys or unique keys that are not null.
--truncate-table No Specifies whether to truncate the target table before data import. (Not recommended. We recommend that you manually truncate the table.)
--with-data-files No Specifies whether to truncate or delete data from tables that have data files. 3.1.0
--delete-from-table No Specifies whether to delete all data from all tables in the target database before data import. (Not recommended. We recommend that you manually delete data from tables.)
-V(--version) No Displays the version of OBLOADER.
--no-sys No Indicates that the sys tenant password cannot be provided in the OceanBase Database environment. 3.3.0
--logical-database No Indicates that the data is imported from an ODP (Sharding) logical database. 3.3.0
--file-regular-expression No Specifies the regular expression for the file name of a single table. 3.3.0
--ignore-escape No Specifies whether to ignore character escaping when importing a CUT file. 3.3.0
--storage-uri No Specifies the uniform resource locator (URL) for storage. 4.2.0
--character-set No Specifies the character set when creating a database connection.
Default value: The value of the jdbc.url.character.encoding parameter in the session variables file. The value specified by the --character-set option overrides the value of the jdbc.url.character.encoding parameter. This option supports the following character sets: binary, gbk, gb18030, utf16, and utf8mb4.
4.2.4
--strict No Specifies whether to control the impact of dirty data on the process exit status. 4.2.4
--session-config No Specifies the connection configuration file. 4.2.6
-H(--help) No Displays the help information of the OBLOADER 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
Features
Performance options
Other options
Options