Ecological Tools
Supported Versions:

MVD Usage

MVD is command line tool can be run only in the Shell interface. You can query the command help information by running the -h command.

    MVD is a data verification tool for Heterogeneous Databases.

    -h, --help           : Show help message
    -v, --version        : Show tool version [2.4.0]
    -x, --debug          : Run in debug mode, means more output logs
        --debug-md5      : Debug for print data before calculator MD5
    -c, --config-file    : Using a config file with format json
        --mtk-config     : Using a config file from MTK tool with format json
    -C, --catagory       : Compare catagory: A=All, M=Metadata, D=Data
    -d, --func-dimension : [Advanced Option] Functions used in data comparison
                         : Default: avg:a,min:np,max:np,median:np
                         : Format: <name>:<primary_type>    -- Same function name among all database
                         :         <primary_type> := a|p|np, a = all, p = primary table, np = not [p]
                         :                           can be ignored, then use default [a]
                         : Format: <name>:<function_list>:<primary_type>
                         :         <function_list> := <db_type> = <function_name> | <db_type> = <function_name>
                         :         <db_type> := ORACLE|DB2|MYSQL|POSTGRESQL|MOGDB|OPENGAUSS
                         : Example 'testmin:oracle=min|mogdb=min|mysql=min|db2=min:p'
    -s, --source-db      : Source database to be verified
                         : Format: <db_type>:<ip>:<port>:<name>:<user>:<password>
                         :         <db_type> :=
                         : Example 'testmin:oracle=min|mogdb=min|mysql=min|db2=min:p'
    -s, --source-db      : Source database to be verified
                         : Format: <db_type>:<ip>:<port>:<name>:<user>:<password>
                         :         <db_type> := ORACLE|DB2|MYSQL|POSTGRESQL|MOGDB|OPENGAUSS
    -t, --target-db      : Target database to be verified, format see also '-s'
    -w, --workers        : Parallel workers (1~32), default: 8
    -T, --table          : Check a single table
                         : Format: <owner>.<table_name>
                         :   Tips: if this option was specified, then '-i' and '-e' will be ignored
    -i, --include        : White list, patterns used for object filter, all patterns combined with comma
                         : Format: <type>:<owner>.<object_name>,...
                         :         <type>:<object_name>
                         :         <owner>.<object_name>
                         :         <object_name>
                         : Notes: 1. <type> can use: */%/TABLE/VIEW/SEQUENCE/PROCEDURE/FUNCTION/OTHERS
                         :        2. Can use */% in <owner> and <object_name> field, means to match all
    -e, --exclude        : Black list, patterns used for object filter, format see also '-i'
    -r, --remap-schema   : Schema transformation in comparision
                         : Format: <source_schema>:<target_schema>,<source_schema>:<target_schema>...
    -f, --result-file    : Result file, used to save result, default to print result to screen
    -F, --result-format  : Result file data format: json (default), plain
    -R, --row-dir        : Row directory for differences data (MD5 & KEY)
        --row-feedback   : Query row data when differences found, otherwise just key condition listed
        --ignore-float   : Ignore float data type in comparison
    -z, --zero-char      : Specify a char for chr(0) in comparason, Default is empty char
    -Z, --time-zone      : Specify timezone for DB client, set empty use local, default is UTC(+00:00)
    -l, --logfile        : Write output information to logfile

    1. Verify a single table  (Using Statistics Analysis)
       ./mvd_macos_x86_64 -s
    2. Verify a single schema  (Using MD5 ROW-BY-ROW)
       ./mvd_macos_x86_64 -s 'ORACLE:' -t 'MOGDB:' -i 'HONGYE.*' -R './diff'

Command Line Option Description

Command Option Description
-h, --help Shows the help information of the tool.
-v, --version Shows the current version of the tool.
-x, --debug Enables the debug mode and outputs more detailed log content.
This option is used only in the debugging process.
--debug-md5 Outputs the original value of the Python MD5 computing result. This option will open all data of a DB2/Oracle table and therefore large disk log space will be occupied. Please use it with caution.
-c, --config-file Specifies configuration parameters (JSON format) used during program execution. Configuration parameters can replace the specific command line options.
--mtk-config Specifies the configuration file (JSON format) used during MTK execution. It is used for verifying objects and table data involved in MTK synchronization.
-C, --catagory Specifies the comparison category. A refers to comparison of all information. M refers to comparison of only object structure. D refers to comparison of only data.
-d, --func-dimension This is an advanced option. If you are not very clear about its meaning, do not use it.
Specifies the dimension of the statistical function during data comparison. The input format is as follows:
1. <name>:<primary_type>
2. <name>:<function_list>:<primary_type>
The value of primary_type an be a (all tables), p (primary key tables), and np (non-key value tables).
name indicates the function name. If the function name is the actual function used in a database, the name does not need to be specified. Otherwise, the name needs to be specified.
function_list indicates the format of the function in different databases. The format is <db_type>=<function_name> | <db_type>=<function_name> | ...
The value of db_type can be ORACLE, DB2, MYSQL, POSTGRESQL, MOGDB, and OPENGAUSS.
-s, --source-db Specifies the source database. The input format is <db_type>:<ip>:<port>:<name>:<user>:<password>.
The value of db_type can be ORACLE, DB2, MYSQL, POSTGRESQL, MOGDB, and OPENGAUSS.
-t, --target-db Specifies the target database. The input format is the same as that of -s.
-w, --workers Specifies the number of concurrent processes during data comparison. The value ranges from 1 to 32. The default value is 8.
-T, --table Specifies a single table to be compared. The input format is <owner>.<table_name>. Wildcard characters are not allowed to be used because they will conflict with -i and -e.
-i, --include Specifies a list of objects to be included for comparison. You can specify multiple matching modes and separate them with commas.
The matching format includes <type>:<owner> .<object_name>, <owner>.<object_name>, <object_name>, ....
* or % can be used in OWNER and OBJECT_NAME to mark wildcard characters.
-e, --exclude Specifies the list of objects to be excluded. The format is the same as that of -i.
-r, --remap-schema Specifies the mapping of schemas in the source and target databases during comparison. The schemas in the source and target databases have the same name but do not have the mapping relation by default.
-f, --result-file Specifies the comparison result file. By default, no file will be generated, and the result is shown in the command line window.
-F, --result-format Specifies the comparison result format, including json and plain. The default value is plain, indicating the text format which is convenient for the user to read.
-R, --row-dir Specifies the folder where the row difference result is generated upon the execution of the MD5 row-by-row comparison mode. For each table with a difference, a difference file is created in that directory.
--row-feedback Specifies whether to show the full data of a difference row. Only KEY of a difference row is shown by default. (The KEY indicates ROWID in Oracle and CTID in PostgreSQL.)
--ignore-float Specifies whether to ignore the floating-point type (float, double, real, and other non-precise types) during data comparison. The floating-point type is not ignored by default.
-z, --zero-char Specifies the replacing character of the chr(0) character during comparison. The default value is null, which is to remove the chr(0) invisible characters.
-Z, --time-zone Specifies the time zone of the client data query, set the empty string to use the local OS time zone, if not set, use UTC (+00:00) time zone
-l, --logfile Specifies the log file for tool running.

Examples of Common Commands

The following lists command examples in common scenarios (using the MacOS 2.0 as an example).

Note: The method of comparing statistical eigenvalues is inefficient. It is recommended to use the MD5 row-by-row comparison method.

  1. Compare the structures and data between Oracle and MogDB.

    ./mvd_macos_x86_64 -s 'ORACLE:' -t 'MOGDB:' -i 'mtk.*' -R './diff'
  2. Compare the structures and data between DB2 to MogDB.

    ./mvd_macos_x86_64 -s 'DB2:' -t 'MOGDB:' -i 'mtk.*' -R './diff'
  3. Compare the structures and data between MySQL to MogDB.

    ./mvd_macos_x86_64 -s 'MYSQL:' -t 'MOGDB:' -i 'mtk.*' -R './diff'
  4. Compare data in a table (eigenvalue comparison).

    ./mvd_macos_x86_64 -s 'ORACLE:' -t 'MOGDB:' -T 'HONGYE.TEST'
  5. Compare data and structures and precisely recognize rows that involve difference.

    ./mvd_macos_x86_64 -s 'ORACLE:' -t 'MOGDB:' -i 'mtk.*' -R './diff'
  6. Perform data verification after migration according to the MTK configuration file.

    ./mvd_macos_x86_64 --mtk-config oracle2opengauss.json
A commercial database developed by ENMOTECH based on openGauss open source database.
Yunhe EnmoCommunity
MogDBContact Us
Management Tools
High Availability
Graphical Management
Migrate to MogDB Solution
Database Migration Toolkit
MogDB Data Bridge
SQL Compatibility Analyzer
MogDB Verify Data