OceanBase logo

OceanBase

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

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

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

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Loader and Dumper

V4.3.3

  • Document Overview
  • Introduction
  • Technical mechanism
  • Preparations
    • Prepare the environment
    • Prepare data
    • Download OBLOADER & OBDUMPER
  • User Guide (OBLOADER)
    • Quick start
    • Command-line options
    • Direct load
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Use cases of command-line options
    • Performance tuning
    • Error handling
    • FAQ
  • User Guide (OBDUMPER)
    • Quick start
    • Command-line options
    • Data processing
      • Define control files
      • Preprocessing functions
      • Case expressions
    • Performance tuning
    • FAQ
  • Security features
  • Connection settings
  • Self-service troubleshooting
  • Release Note
    • Release Note
      • 4.x
        • OBLOADER & OBDUMPER V4.3.3
        • OBLOADER & OBDUMPER V4.3.2.1
        • OBLOADER & OBDUMPER V4.3.2
        • OBLOADER & OBDUMPER V4.3.1.1
        • OBLOADER & OBDUMPER V4.3.1
        • OBLOADER & OBDUMPER V4.3.0
        • OBLOADER & OBDUMPER V4.2.8.2
        • OBLOADER & OBDUMPER V4.2.8.1
        • OBLOADER & OBDUMPER V4.2.8
        • OBLOADER & OBDUMPER V4.2.6
        • OBLOADER & OBDUMPER V4.2.7
        • OBLOADER & OBDUMPER V4.2.5
        • OBLOADER & OBDUMPER V4.2.4
        • OBLOADER & OBDUMPER V4.2.1
        • OBLOADER \& OBDUMPER V4.1.0
        • OBLOADER \& OBDUMPER V4.0.0
      • 3.x
        • OBLOADER \& OBDUMPER V3.1.0
        • OBLOADER \& OBDUMPER V3.0.0
    • Version rules

Download PDF

Document Overview Introduction Technical mechanism Prepare the environment Prepare data Download OBLOADER & OBDUMPER Quick start Command-line options Direct load Define control files Preprocessing functionsCase expressions Use cases of command-line options Performance tuning Error handling FAQ Quick start Command-line options Define control files Preprocessing functionsCase expressions Performance tuning FAQ Security features Connection settings Self-service troubleshooting Version rules
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Loader and Dumper
  3. V4.3.3
iconOceanBase Loader and Dumper
V 4.3.3
  • V 4.3.5
  • V 4.3.4.1
  • V 4.3.4
  • V 4.3.3.1
  • V 4.3.3
  • V 4.3.2.1
  • V 4.3.2
  • V 4.3.1
  • V 4.2.8
  • V 4.2.7
  • V 4.2.6
  • V 4.2.5 and earlier

Security features

Last Updated:2025-03-05 02:55:22  Updated
share
What is on this page
Use secure-gen to encrypt information
View the help information of secure-gen
Customize an encryption/decryption mechanism
Examples

folded

share

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 provides methods to encrypt and decrypt sensitive information on command lines.

Use secure-gen to encrypt information

  1. Install OpenSSL and configure environment variables.

    Note

    To use secure-gen to encrypt information, you must install the OpenSSL toolkit. For more information, see the "View the help information of secure-gen" section in this topic.

  2. Verify that OpenSSL is installed.

    $ which openssl
    
    /usr/bin/openssl
    
  3. Encrypt sensitive files in the local path.

    ./secure-gen -n <file_path>
    

    Note

    Sensitive information files must meet the specifications described in Property File Format. You can also edit the sensitive information to be encrypted in the CLI. Example:

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

      ./secure-gen -i
      
    2. Edit the parameters to be encrypted in the CLI and then enter :wq to save and exit.

      # Input the sensitive fields below in plain-text respectively.
      # Note you can leave any of them as blank, ob-loader-dumper will parse from cli args first, and override any field if there is a conflict.
      #   
      # Database password.
      oceanbase.jdbc.password=******
      # Database password for sys tenant.
      oceanbase.jdbc.sys.password=******
      # Access key for cloud storages like OSS & S3.
      cloud.storage.access.key=******
      # Secret key for cloud storages like OSS & S3.
      cloud.storage.secret.key=******  
      
      :wq
      

      The following table lists the sensitive parameters that can be encrypted by OBLOADER & OBDUMPER.

      Parameter Description
      oceanbase.jdbc.password Optional. The password of a business tenant of OceanBase Database.
      oceanbase.jdbc.sys.password Optional. The password of the sys tenant in OceanBase Database.
      cloud.storage.access.key Optional. The AccessKey ID used to access a cloud storage service such as Amazon Simple Storage Service (S3) or Alibaba Cloud Object Storage Service (OSS).
      cloud.storage.secret.key Optional. The AccessKey secret used to access a cloud storage service such as Amazon S3 or Alibaba Cloud OSS.
  4. You can choose whether to use an existing key as prompted.

    $ ./secure-gen
    Detected that a key already exists, do you want to use it?
    If not, a new key will be generated and overwrite the existing key (y/n):
    
    1. Enter n to regenerate a key pair by using OpenSSL. By default, the key pair is stored in the <Root directory of the user>/.loaddump/secure/ directory. By default, the public key file is key.pem.pub, and the private key file is key.pem.

      Detected that a key already exists, do you want to use it?
      If not, a new key will be generated and overwrite the existing key (y/n): n
      Generating RSA private key, 4096 bit long modulus
      ............++
      .......................................................++
      e is 65537 (0x10001)
      Writing RSA key
      
      The key pair has been generated under the directory /Users/chang/.loaddump, please keep it safe.
      The encrypted file /Users/chang/.loaddump/secure/secure.rsa has been generated for sensitive information.
      
      If you want to use it, please fill in the corresponding content in conf/decrypt.properties properly.
      
    2. Enter y to use an existing key pair. OBLOADER & OBDUMPER load the key pair from the /.loaddump/secure/ directory and generate an encrypted file, such as secure.rsa.

      Detected that a key already exists, do you want to use it? If not, a new key will be generated and overwrite the existing key (y/n): y
      The encrypted file /Users/chang/.loaddump/secure/secure.rsa has been generated for sensitive information.
      
      If you want to use it, please fill in the corresponding content in conf/decrypt.properties properly.
      
  5. Verify whether the key pair and encrypted file are generated.

    $ ls ~/.loaddump/secure/
    key.pem     key.pem.pub    secure.rsa
    
  6. Enter the encrypted information in decrypt.properties in the {ob-loader-dumper}/conf/decrypt.properties directory.

    # Absolute path of your secure file, whose name is secure.rsa by default.
    # secure.filePath=
    
    # Absolute path of your private key. whose name is key.pem by default.
    # privateKey.filePath=
    
    # Decrypt class name. Fill in this field only if you need a custom mechanism of decryption.
    # decrypt.className=
    

View the help information of secure-gen

secure-gen is an executable Shell script. It can encrypt sensitive information fields by using the RSA algorithm. When you run OBLOADER or OBDUMPER, it will parse decrypt.properties in the {ob-loader-dumper}/conf directory to securely obtain sensitive information.

secure-gen is located in the {ob-loader-dumper}/tools/ directory. You can run ./secure-gen -h or directly enter ./secure-gen to view the help information of secure-gen.

$ ./secure-gen -h

Usage: ./secure-gen [-n <file>][-i][-h]
Description:
-n: Specify a to-be-encrypted file of sensitive contents in plain-text, use -i to check out the format.
-i: Input sensitive contents in interactive mode.
-h: Display this message.

Customize an encryption/decryption mechanism

If OpenSSL is not installed, you can perform the following steps to customize an encryption/decryption mechanism.

  1. Create a plaintext file for encryption.

    The file to be encrypted must meet the specifications described in "Properties File Format." For more information, visit Properties File Format.

  2. Write a decryption class file in Java. The class definition must meet the following requirements:

    • A parameterless constructor function must be defined.

    • The class must have a non-static method: public String decrypt(String encryptRaw). The encryptRaw formal parameter indicates the encrypted text. The return value is the decrypted text.

  3. Package the decryption class as a JAR package and place the package in the {ob-loader-dumper}/lib/ directory.

  4. Configure corresponding content in decrypt.properties in the {ob-loader-dumper}/conf directory.

Examples

Create a Maven project and write a CustomDecryptor class. Use Base64 for encoding and decoding.

Note

In a production environment, you can choose an appropriate encryption/decryption algorithm as needed.

  1. Create a plaintext file for encryption and encode the file by using Base64.

    # Create a plaintext file.
    $ vi password.txt
    # Enter the following content in the file. Then, save the file and exit.
    oceanbase.jdbc.password=******
    oceanbase.jdbc.sys.password=******
    
    # Encrypt the encoded file as custom.key.
    $ echo $(base64 password.txt) > /user/loaddump/custom.key
    
  2. Create a Java project. In the project, CustomDecryptor.java is a custom decryption class that you need to write.

    customdecryptor
  3. Write the CustomDecryptor class.

    package com.example.decrypt;
    
    import java.nio.charset.StandardCharsets;
    import sun.misc.BASE64Decoder;
    
    public class CustomDecryptor {
    
       public CustomDecryptor() {}
    
        /**
        * This method takes an encrypted string, decrypt it, and return it as a plain string.
        */
       public String decrypt(String encryptedRaw) throws Exception {
           BASE64Decoder decoder = new BASE64Decoder();
           return new String(decoder.decodeBuffer(encryptedRaw), StandardCharsets.UTF_8);
      }
    }
    
    
  4. Package the CustomDecryptor class as a JAR package and place the package in the {ob-loader-dumper}/lib/ directory to finish setting the decryptor.

    mvn package && mv target/example-1.0-SNAPSHOT.jar path/to/ob-loader-dumper/lib/
    
  5. Enter corresponding content in decrypt.properties in the {ob-loader-dumper}/conf/ directory.

    # Absolute path of your secure file, whose name is secure.rsa by default.
    secure.filePath=~/tmp/custom.key
    # Absolute path of your private key. whose name is key.pem by default.
    # privateKey.filePath=
    # Decrypt class name. Fill in this field only if you need a custom mechanism of decryption.
    decrypt.className=com.example.decrypt.CustomDecryptor
    

    Note

    If you use a custom SDK for encryption and decryption, the privateKey.filePath parameter is optional.

  6. Securely run OBLOADER & OBDUMPER.

    ./obdumper -hxx.x.x.x -P2883 -t example -D example --csv --all
    

    Note

    When you run OBLOADER & OBDUMPER, you do not need to explicitly declare the -p/--password or --sys-password option.

Previous topic

FAQ
Last

Next topic

Connection settings
Next
What is on this page
Use secure-gen to encrypt information
View the help information of secure-gen
Customize an encryption/decryption mechanism
Examples