OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Loader and Dumper

V5.0.0
  • Document Overview
  • Introduction
  • Technical Mechanism
  • Preparations
    • Prepare the environment
    • Prepare data
    • Download OBLOADER & OBDUMPER
    • Startup parameters
  • User Guide (OBLOADER)
    • Quick start
    • Command-line options
    • Multi-database import
    • Direct load
    • Data processing
      • Define a control file
      • Preprocessing functions
      • Case expressions
    • Use cases of command-line options
    • Performance tuning
    • Error handling
    • FAQ
  • User Guide (OBDUMPER)
    • Quick start
    • Command-line options
    • Multi-database export
    • Data processing
      • Define a control file
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • FAQ
  • Control file guide
  • Security Features
  • Connection configuration
  • Self-service Troubleshooting
  • Release Note
    • Release Note
      • 5.x
        • OBLOADER & OBDUMPER V5.0.0
      • 4.x
        • OBLOADER & OBDUMPER V4.3.7
        • OBLOADER & OBDUMPER V4.3.6
        • OBLOADER & OBDUMPER V4.3.5
        • OBLOADER & OBDUMPER V4.3.4.1
        • OBLOADER & OBDUMPER V4.3.4
        • OBLOADER & OBDUMPER V4.3.3.1
        • OBLOADER & OBDUMPER V4.3.3
        • OBLOADER & OBDUMPER V4.3.2.1
        • OBLOADER & OBDUMPER V4.3.2
        • OBLOADER & OBDUMPER V4.3.1.1
        • OBLOADER & OBDUMPER V4.3.1
        • OBLOADER & OBDUMPER V4.3.0
        • OBLOADER & OBDUMPER V4.2.8.2
        • OBLOADER & OBDUMPER V4.2.8.1
        • OBLOADER & OBDUMPER V4.2.8
        • OBLOADER & OBDUMPER V4.2.7
        • OBLOADER & OBDUMPER V4.2.6
        • OBLOADER & OBDUMPER V4.2.5
        • OBLOADER & OBDUMPER V4.2.4
        • OBLOADER & OBDUMPER V4.2.1
        • OBLOADER & OBDUMPER V4.2.0
        • OBLOADER & OBDUMPER V4.1.0
        • OBLOADER & OBDUMPER V4.0.0
      • 3.x
        • OBLOADER & OBDUMPER V3.3.2
        • OBLOADER \& OBDUMPER V3.1.0
        • OBLOADER \& OBDUMPER V3.0.0
    • Versioning rules

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Loader and Dumper
  3. V5.0.0

Security Features

Last Updated:2026-11-10 11:21:27

Quick start: Encrypt credentials with secure-gen
Configure passwords and generate an encrypted file
Credential matching rules for multiple accounts
Compatibility and migration
View secure-gen help
Advanced usage: Use custom encryption and decryption
Example
Connect to a database over SSL
Method 1: Configure SSL parameters to enable SSL connection
Method 2: Use secure-gen for encryption

By default, OBLOADER & OBDUMPER can run after you explicitly specify sensitive information such as the password on the command line. To enhance information security, OBLOADER & OBDUMPER V4.2.0 and later provide methods to encrypt and decrypt sensitive information on the command line.

Quick start: Encrypt credentials with secure-gen

OBLOADER & OBDUMPER V5.0.0 can store passwords for multiple business accounts and sys tenant accounts in a single encrypted file. Passwords are matched by username, tenant name, cluster name, host address, and port.

Configure passwords and generate an encrypted file

  1. Install OpenSSL and configure the environment variables. Run the following command to verify that the system can find OpenSSL.

    $ which openssl
    /usr/bin/openssl
    
  2. Configure passwords for the required accounts. The following example defines two business accounts. Replace the sample passwords with actual values.

    oceanbase.jdbc.password.core_user=CORE_PASSWORD
    oceanbase.jdbc.password.loan_user=LOAN_PASSWORD
    

    In the {ob-loader-dumper}/tools/ directory, use either of the following methods to generate an encrypted file. The configuration must follow the Properties File Format.

    • From a file: Save the configuration to passwords.properties and run the following command.

      ./secure-gen -n /path/to/passwords.properties
      
    • Interactively: Run the following command, enter the configuration in vi, press Esc, and enter :wq to save and exit.

      ./secure-gen -i
      

    The following table lists the properties for passwords and other sensitive information. For account identifier formats and matching order, see "Credential matching rules for multiple accounts" below.

    Property
    Description
    oceanbase.jdbc.password.<account_identifier> Business account password, corresponding to -p or --password on the command line.
    oceanbase.jdbc.sys.password.<account_identifier> sys tenant account password, corresponding to --sys-password on the command line.
    oceanbase.jdbc.password Default business account password. Used only when no business account password properties include an account identifier.
    oceanbase.jdbc.sys.password Default sys tenant password. Used only when no sys tenant password properties include an account identifier.
    oceanbase.jdbc.trustStorePassword trustStore password for SSL connections. Not matched by account.
    oceanbase.jdbc.keyStorePassword keyStore password for SSL connections. Not matched by account.
    cloud.storage.access.key Cloud storage account access key (access-key). Not matched by account.
    cloud.storage.secret.key Cloud storage secret access key (secret-key). Not matched by account.

    Keep the following in mind:

    • Property names are case-sensitive. Password values do not require quotation marks. Escape backslashes, as well as special characters in property names, according to Properties syntax.
    • An empty value specifies an empty password, as in oceanbase.jdbc.password.empty_user=. It does not mean that the account is unconfigured.
    • If a property name appears more than once, the last entry takes effect. Do not use duplicate property names for different accounts.
    • When creating or regenerating keys, the entire plaintext file must not exceed 1920 bytes, including comments and line breaks. When reusing keys, the limit depends on the actual key capacity. Keep only the required content; do not encrypt the full conf/secure-passwords.example.properties file.
  3. If a key pair already exists, choose whether to reuse it when prompted.

    • Enter y to reuse the key pair and regenerate secure.rsa. If the plaintext file exceeds the size limit for the existing key, the tool returns an error and preserves the existing credentials. Reduce the file size. If the file is no larger than 1920 bytes, you can also rerun the command and choose n to try regenerating the keys.
    • Enter n to regenerate the key pair and encrypted file. Before doing so, pause the launch of new import and export tasks. The tool backs up the existing credentials and displays the backup directory.

    The key pair and encrypted file are stored in ~/.loaddump/secure/ under the current operating system user. The public key is key.pem.pub, the private key is key.pem, and the encrypted file is secure.rsa.

  4. After encryption succeeds, verify that the output directory contains the following three files.

    $ ls ~/.loaddump/secure/
    key.pem     key.pem.pub    secure.rsa
    
  5. Specify the absolute paths to the encrypted file and private key in {ob-loader-dumper}/conf/security.properties. For example:

    encrypt.filePath=/home/admin/.loaddump/secure/secure.rsa
    secretKey.filePath=/home/admin/.loaddump/secure/key.pem
    

    Replace the sample paths with actual paths. When using secure-gen, leave security.className empty or comment it out.

    The legacy properties secure.filePath and privateKey.filePath are still supported. They correspond to encrypt.filePath and secretKey.filePath, respectively. We recommend using the new properties.

  6. In the {ob-loader-dumper}/bin/ directory, run OBLOADER or OBDUMPER with the corresponding account and omit the password options already configured. For example, export data with the two accounts configured earlier:

    ./obdumper -h 10.0.0.11 -P 2881 -u core_user -t obmysql -D core_db --csv --all -f /data/core_export
    ./obdumper -h 10.0.0.11 -P 2881 -u loan_user -t obmysql -D loan_db --csv --all -f /data/loan_export
    

    Use actual accounts with the required privileges, and replace the connection parameters and export directories to suit your environment. If the task requires a sys connection, also provide the sys tenant account password. OBLOADER uses the same credential matching rules.

Credential matching rules for multiple accounts

Account identifiers support the following formats. You can restrict an entry to a tenant, cluster, or connection address as needed:

username
username@tenant
username@tenant#cluster
username|host|port
username@tenant|host|port
username@tenant#cluster|host|port

The following example configures different passwords for users with the same name at different addresses, plus a password for a sys tenant account:

oceanbase.jdbc.password.root@obmysql|10.0.0.11|2881=IP11_PASSWORD
oceanbase.jdbc.password.root@obmysql|10.0.0.12|2881=IP12_PASSWORD
oceanbase.jdbc.sys.password.root@sys|10.0.0.11|2881=SYS_IP11_PASSWORD
  • Business account identifiers use the username, tenant name, and cluster name parsed from -u, -t, and -c. Both -u user@tenant#cluster and -u user -t tenant -c cluster can match the same entry.
  • The sys user is specified by --sys-user and defaults to root. The tenant used for matching is always sys. Matching occurs only when a sys connection is required and its password must be read from the encrypted file. It is skipped when --no-sys is specified.
  • With --public-cloud or --logical-database, business account matching uses the username and optional address restriction, without the tenant or cluster parts.
  • The host address must exactly match -h. Matching is case-sensitive and does not perform DNS resolution. Specify the port in the property name as a decimal integer without leading zeros, such as 2881.
  • | is a reserved separator and cannot appear in usernames or hostnames. Escape colons in IPv6 addresses according to Properties syntax.

Passwords specified by -p or --sys-password take precedence. If the value is empty or contains only whitespace, the password is still read from the credential configuration.

When using an encrypted file, entries with a host and port are checked before entries without an address. Within each group, the order is username + tenant + cluster, username + tenant, then username. For a business connection that specifies a tenant, cluster, and address, the matching order is:

oceanbase.jdbc.password.username@tenant#cluster|host|port
oceanbase.jdbc.password.username@tenant|host|port
oceanbase.jdbc.password.username|host|port
oceanbase.jdbc.password.username@tenant#cluster
oceanbase.jdbc.password.username@tenant
oceanbase.jdbc.password.username

If no tenant or cluster is specified, entries that require it are skipped. The first matching value is used. sys tenant passwords follow the same order, with the prefix oceanbase.jdbc.sys.password and tenant sys.

Compatibility and migration

Business account passwords and sys tenant passwords are handled independently:

  • If no password properties include an account identifier, the corresponding default property is used: oceanbase.jdbc.password or oceanbase.jdbc.sys.password.
  • Adding a password property with an account identifier enables configuration for multiple accounts in that category. When a password is read from the encrypted file, failure to match the current connection returns an error; the tool does not fall back to the default password.
  • The two categories are independent. For example, business accounts can use multiple-account configuration while the sys tenant still uses the default password property. TLS and cloud storage properties do not affect which mode is used.

To migrate, add entries for all accounts that need to read passwords from the encrypted file, then encrypt the file again.

View secure-gen help

secure-gen is an executable shell script in {ob-loader-dumper}/tools/ that uses RSA to encrypt sensitive information. At runtime, OBLOADER & OBDUMPER use conf/security.properties to locate the encrypted file and private key, then decrypt and read the credentials.

Run ./secure-gen -h or ./secure-gen without arguments to view help:

$ ./secure-gen -h
Usage: ./secure-gen [-n <file>][-i][-h]
-n: Encrypt a properties file; use -i to see the format.
-i: Edit sensitive properties interactively.
-h: Display this message.

Advanced usage: Use custom encryption and decryption

You can write a Java decryption class to read password configurations encrypted with your own mechanism, without OpenSSL.

  1. Encrypt a password configuration in Properties format and save it to a file.

  2. Write a public Java decryption class with a public no-argument constructor and the non-static method public String security(String encryptedRaw). This method receives the encrypted file contents and returns the plaintext configuration in Properties format.

  3. Package the decryption class into a JAR file and place it in {ob-loader-dumper}/lib/.

  4. In {ob-loader-dumper}/conf/security.properties, set encrypt.filePath to the file path and security.className to the fully qualified name of the decryption class.

Example

The following example uses Base64 to demonstrate the custom decryption interface. Base64 encoding does not provide encryption protection. Use an appropriate encryption and decryption algorithm in production.

  1. Create password.txt with the following password configuration. Replace the sample passwords with actual values.

    oceanbase.jdbc.password=BUSINESS_PASSWORD
    oceanbase.jdbc.sys.password=SYS_PASSWORD
    

    Encode the file and save it as custom.key. Replace the sample path to suit your environment, and use the same path in the subsequent configuration.

    mkdir -p /user/loaddump
    base64 < password.txt > /user/loaddump/custom.key
    
  2. Create a Maven project. In the project structure below, CustomDecryptor.java is the custom decryption class to implement.

    customdecryptor
  3. Implement the CustomDecryptor class.

    package com.example.decrypt;
    
    import java.nio.charset.StandardCharsets;
    import java.util.Base64;
    
    public class CustomDecryptor {
        public CustomDecryptor() {}
    
        public String security(String encryptedRaw) {
            byte[] decoded = Base64.getMimeDecoder().decode(encryptedRaw);
            return new String(decoded, StandardCharsets.UTF_8);
        }
    }
    
  4. Package the CustomDecryptor class into a JAR file and place it in {ob-loader-dumper}/lib/.

    mvn package
    cp target/example-1.0-SNAPSHOT.jar /path/to/ob-loader-dumper/lib/
    

    Replace the sample JAR filename and tool path with actual values.

  5. Set the following properties in {ob-loader-dumper}/conf/security.properties.

    encrypt.filePath=/user/loaddump/custom.key
    security.className=com.example.decrypt.CustomDecryptor
    

    Custom decryption does not read secretKey.filePath, so you can omit this property.

  6. In the {ob-loader-dumper}/bin/ directory, run OBLOADER or OBDUMPER and omit the password options already configured. For example:

    ./obdumper -h 10.0.0.11 -P 2881 -u core_user -t obmysql -D core_db --csv --all -f /data/core_export
    

    Replace the connection parameters and export directory to suit your environment.

Connect to a database over SSL

OBLOADER & OBDUMPER V4.3.1 and later allow you to connect to a database over SSL. This section describes two methods for connecting to a database over SSL.

Method 1: Configure SSL parameters to enable SSL connection

Configure SSL parameters in the session.config.json file. For more information about the file, see Connection configuration.

"useSSL": true,
"disableSslHostnameVerification": true,
"trustStore": "http://xxx.xxx.xxx.xxx:39411/rpcssl/truststore.jks",
"trustStorePassword": "123xxxx",
"//keyStore": "xxxxx",
"//keyStorePassword": ""

Configure the trustStore and trustStorePassword parameters based on the actual situation.

  • The value of trustStore can be an HTTP URL or a local path, for example, "trustStore": "/home/admin/downloads/truststore.jks".

  • The value of trustStorePassword is a plaintext password. Pay attention that it is not the database password.

Method 2: Use secure-gen for encryption

You can also use secure-gen to connect to the database to improve security and reduce security risks. The procedure is as follows:

  1. Install OpenSSL and configure environment variables.

  2. Run the following command in the {ob-loader-dumper}/tools/ directory:

    ./secure-gen -i
    
  3. Configure related password parameters in the CLI and then enter :wq to save and exit.

    # Input the sensitive fields below in plain-text respectively.
    # Note ob-loader-dumper will parse from cli args first, and override any field in this file if there is a conflict.
    #
    # This password used for creating JDBC Connection.
    oceanbase.jdbc.password=*******
    # This password used for creating JDBC Connection of sys tenant.
    oceanbase.jdbc.sys.password=******
    # Trust store password for creating JDBC Connection with useSSL=true.
    oceanbase.jdbc.trustStorePassword=******
    # Key store password for creating JDBC Connection with useSSL=true (×509).
    # oceanbase.jdbc.keyStorePassword=
    # AccessKey for cloud storages like OSS, S3.
    # cloud.storage.access. key=
    # SecretKey for cloud storages like
    
  4. By default, the encrypted file and key are locally generated by using OpenSSL. Place the encrypted file (secure.rsa) and key (key.pem) to the security.properties file in the conf/ directory.

    You can also place the encrypted file and key on different HTTP servers. OBLOADER & OBDUMPER automatically loads the encrypted file and key at startup and then decrypts the information.

Previous topic

Control file guide
Last

Next topic

Connection configuration
Next
on this page
Quick start: Encrypt credentials with secure-gen
Configure passwords and generate an encrypted file
Credential matching rules for multiple accounts
Compatibility and migration
View secure-gen help
Advanced usage: Use custom encryption and decryption
Example
Connect to a database over SSL
Method 1: Configure SSL parameters to enable SSL connection
Method 2: Use secure-gen for encryption