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 |
|
| 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 |
|
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
--directand--parallelto 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
-soption 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.
- When connecting to the ODP service endpoint:
--direct
Specifies direct load mode. This option is used in conjunction with
--rpc-portand--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-portand--direct.
Feature options
File formats
| Format (CLI option) | Related CLI options | Scenarios |
|---|---|---|
| --csv Specifies the CSV format. |
|
Applies to almost all scenarios. |
| --cut Specifies the CUT format. |
|
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. |
|
Applies to scenarios where only data is imported, not the schema. Supports only one SQL syntax, but performs well. |
| --mix Specifies the MIX format. |
|
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. |
|
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. |
|
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.
|
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
--alloption is mutually exclusive with any other database object option. If both--alland another database object option are specified, the--alloption 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
--tableoption.--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
--tablemust 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
--tableoption.--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
--tableoption.--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
--tableoption. 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
--tableoption. 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
--tableoption. 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
--tableoption. 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
--tableoption. 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
--tableoption. 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
--tableoption.--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
--tableoption.
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
-foption 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
-foption. 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.
- The load.ckpt file is a checkpoint file generated during the tool's runtime, located in the directory specified by
--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-discardsor--max-errorsto 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--ddloption.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
--threadoption, the number of file parsing threads is calculated as--threadvalue *--rwvalue.--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
--batchdefault 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
--rwoption, it calculates the number of file parsing threads using the formula:--threadvalue *--rwvalue. The default value isCPU * 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 64indicates 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
--allor--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-filesoption, it truncates only tables that have corresponding data files.Notice
- When using
--allor--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-foption. - 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.
- When using
--with-data-files
When used with the
--truncate-tableor--delete-from-tableoption, 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
--allor--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-filesoption, it deletes only data from tables that have corresponding data files.Notice
- When using
--allor--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-foption. - 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.
- When using
--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
--ddlor--mixoption and does not affect other data format options like--csvor--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.binfile in the directory specified by the-foption 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
|
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. NoticeAvoid 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.
NoticeSQL 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. NoteWhen 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. NoticeA 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.
NoticeCUT 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. |
||
| --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 \.
NoteYou 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. |