How to Migrate Oracle to GaussDB Using Huawei DataSync – A Complete Step‑by‑Step Guide
This article walks through the entire Oracle‑to‑GaussDB migration process with Huawei DataSync, covering environment setup, tool constraints, NFS mounting, JDBC driver preparation, configuration file editing, password encryption, export and import execution, and post‑migration validation.
Background
The previous article described using the SDR tool for Oracle‑to‑GaussDB migration; this follow‑up revisits the earlier DataSync test, which remains a viable alternative.
1. Environment Information
Hardware configuration (images omitted for brevity).
Software configuration
GaussDB side:
Oracle side:
The article does not detail OS installation steps.
2. What is DataSync?
DataSync is Huawei’s GaussDB 100 data‑migration tool supporting online and offline modes for sources such as Sybase, Oracle, MySQL, GaussDB 100 V100R003C10 and SQL Server. After configuring source and target connections, the tool generates logs and reports for ongoing management.
3. DataSync Usage Considerations
Source and target servers must be reachable.
Target tables should be pre‑created with matching structure and compatible data types.
Network connectivity (IP, port, user, password) must be valid.
Ensure sufficient disk space on both sides.
Java 1.8+ must be installed on the machine running DataSync.
The running host’s IP must be whitelisted on both databases.
Place the source JDBC driver in dependency-jars with the exact expected filename.
GaussDB passwords cannot contain spaces or semicolons.
All paths in data_path must follow the whitelist rule (letters, numbers, '\', '/', ':', '-', '_' and cannot start with '-').
4. Preparation Steps
4.1 Mount NFS (optional)
Mount a shared NFS directory on both source and target to avoid network transfer bottlenecks.
su - root
mkdir /datasync
mount -F nfs -o rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,proto=tcp,suid 192.168.xxx.xx:/vx/tycj_dcmp_tmp /datasync4.2 Upload and Extract Media
su - root
cd /datasync
tar -xvf GAUSSDB100-V300R001C00-DATASYNC.tar.gz
cd GAUSSDB100-V300R001C00-DATASYNC
tar -xvf DataSync.tar.gz4.3 Verify Java Version
# java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot 64-Bit Server VM (build 25.231-b11, mixed mode)4.4 Copy JDBC Driver
DataSync lacks an Oracle driver; copy the source driver to dependency-jars and rename it to the expected name.
su - oracle
cd $ORACLE_HOME/jdbc/
cp ojdbc6.jar /datasync/GAUSSDB100-V300R001C00-DATASYNC/DataSync/dependency-jars/ojdbc8-12.2.0.1.jar5. DataSync Configuration
Four configuration files are used: cfg.ini – required, defines server and database connection details. exp_obj.ini – optional, lists objects to export/import. exclusive_obj.ini – optional, lists objects to exclude. ignore_ddl.ini – optional, disables DDL validation for specified objects.
Passwords must be stored as ciphertext. Use the provided DSS.jar utility:
# Export DB password
java -jar DSS.jar -pwd 1
# Import DB password
java -jar DSS.jar -pwd 2
# Import server password
java -jar DSS.jar -pwd 3The cfg.ini example (relevant excerpts) shows JSON‑style entries for export and import databases, including IP, username, encrypted password, port, and optional TLS settings. Important options include: ignore_lost_table – auto‑create missing tables. disable_trigger – disable triggers during import. import_total_task / export_total_task – parallelism levels.
6. Execution
6.1 Export (source side)
cd /datasync/GAUSSDB100-V300R001C00-DATASYNC/DataSync
java -jar DSS.jar -l /datasync/GAUSSDB100-V300R001C00-DATASYNC/DataSync/ -p /datasync/GAUSSDB100-V300R001C00-DATASYNC/DataSync/config/cfg.iniAfter the run, check the generated reports for any failures.
6.2 Import (target side)
Change flow_type from 1 (export) to 2 (import) in cfg.ini:
vi cfg.ini
# set "flow_type":2Optionally import DDL manually if automatic creation is unreliable. Use Oracle’s dbms_metadata.get_ddl to export DDL, adjust unsupported clauses, and apply the TypeMappers/OracleToGauss.json mapping for data‑type conversion.
Then run the same command as for export:
java -jar DSS.jar -l /datasync/GAUSSDB100-V300R001C00-DATASYNC/DataSync/ -p /datasync/GAUSSDB100-V300R001C00-DATASYNC/DataSync/config/cfg.ini7. Validation
DataSync provides logs and CSV reports (e.g., LoadReport.csv) showing row counts and error details. For critical migrations, manually compare source and target objects (tables, indexes, views) to catch missing items such as unsupported indexes or DBLINKs.
8. Summary
The simple DataSync workflow demonstrated includes mounting NFS, preparing JDBC drivers, encrypting passwords, editing cfg.ini, running export and import commands, and performing post‑migration checks. Real‑world migrations may require handling Chinese character encoding, large‑field tables, and foreign‑key constraints, and the tool currently lacks incremental backup support, so plan sufficient time for full data transfers.
dbaplus Community
Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
