HomeMogDBMogDB StackUqbar

Documentation:v3.4

Supported Versions:

MVD Result

The MVD result is directly shown in the readable text format in a terminal by default. The user can output the MVD result in the JSON or Plain format and output the MVD result in a specified result file. The following sections will use the text format to introduce the meaning of each part in the MVD result.

MD5 Row-By-Row Comparison

Run the following command:

./mvd_linux_x86_64 -s 'MYSQL:127.0.0.1:3306::root:pwd' -t 'MOGDB:127.0.0.1:5432:mysql_mtk:hongye:pwd' -i 'mtk.*' -R './diff'

The comparison result is as follows:

>>>> =============================================
>>>> 1. Environments:
>>>> =============================================
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| OPTION             | VALUE                                                                                                                                                 |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| SOURCE_DB          | ['MYSQL', '121.36.15.2', '55444', '', 'root', '******']                                                                                               |
| TARGET_DB          | ['MOGDB', '121.36.15.2', '55432', 'mysql_mtk', 'hongye', '******']                                                                                    |
| WORKERS            | 8                                                                                                                                                     |
| INCLUDE            | [['%', 'MTK', '%']]                                                                                                                                   |
| RESULT_FORMAT      | json                                                                                                                                                  |
| ROW_DIR            | ./diff                                                                                                                                                |
| FUNCTION_DIMENSION | {'AVG': {'TYPE': 'A', 'FUNCTIONS': {'*': 'AVG'}}, 'MIN': {'TYPE': 'NP', 'FUNCTIONS': {'*': 'MIN'}}, 'MAX': {'TYPE': 'NP', 'FUNCTIONS': {'*': 'MAX'}}} |
| CATAGORY           | ALL                                                                                                                                                   |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+

>>>> =============================================
>>>> 2. Summary:
>>>> =============================================
+-----------------------+-------+
| OPTION                | VALUE |
+-----------------------+-------+
| TOTAL_OBJECTS         | 22    |
| DIFF_OBJECTS          | 10    |
| TOTAL_TABLES          | 9     |
| STRUCTURE_DIFF_TABLES | 1     |
| DATA_DIFF_TABLES      | 2     |
+-----------------------+-------+

>>>> =============================================
>>>> 3. Object Differences:
>>>> =============================================
+-------------+-------------------+------------------+
| OBJECT_TYPE | SOURCE_EXTRA      | TARGET_EXTRA     |
+-------------+-------------------+------------------+
| TABLE       | MTK.MTK_TEST      |                  |
|             | MTK.MTK_TEST_1    |                  |
|             | MTK.MTK_TEST_2    |                  |
|             | MTK.MTK_TEST_3    |                  |
|             | MTK.MTK_TEST_4    |                  |
| TRIGGER     | MTK.USER_LOG      |                  |
| SEQUENCE    |                   | MTK.SEQ_LOGS_ID  |
|             |                   | MTK.SEQ_USERS_ID |
| PROCEDURE   | MTK.TEST_MTK_DATA |                  |
|             | MTK.TEST_MTK_TEST |                  |
+-------------+-------------------+------------------+

>>>> =============================================
>>>> 4. Table Structure Differences:
>>>> =============================================
+-------+---------------+-----------------+---------+--------+--------+
| OWNER | TABLE         | TYPE            | NAME    | SOURCE | TARGET |
+-------+---------------+-----------------+---------+--------+--------+
| MTK   | TEST_VARCHAR3 | COLUMN_NULLABLE | ID      | Y      | N      |
| MTK   | TEST_VARCHAR3 | CONSTRAINT      | PRIMARY |        | ID     |
| MTK   | TEST_VARCHAR3 | INDEX           |         |        | ID     |
+-------+---------------+-----------------+---------+--------+--------+

>>>> =============================================
>>>> 5. Table Data Differences (MD5 ROW-BY-ROW):
>>>> =============================================
+-------+----------------+--------+-------------+-------------+-------------+-------------+------------------+------------------+--------------+
| OWNER | TABLE          | Method | SOURCE_ROWS | TARGET_ROWS | SOURCE_DIFF | TARGET_DIFF | SOURCE_SIGNATURE | TARGET_SIGNATURE | CHECK_RESULT |
+-------+----------------+--------+-------------+-------------+-------------+-------------+------------------+------------------+--------------+
| mtk   | bug_1005673    | Normal |           7 |           0 |           7 |           0 |                  |                  |    FAILED    |
| mtk   | tab_data_check | Normal |          22 |           0 |          22 |           0 |                  |                  |    FAILED    |
+-------+----------------+--------+-------------+-------------+-------------+-------------+------------------+------------------+--------------+

>>>> =============================================
>>>> 6. Completed
>>>> =============================================

Summary Signature Comparison

Run the following command:

./mvd_linux_x86_64 -s 'MYSQL:127.0.0.1:3306::root:pwd' -t 'MOGDB:127.0.0.1:5432:mysql_mtk:hongye:pwd' -i 'mtk.*' -m summary

The comparison result is as follows:

>>>> =============================================
>>>> 1. Environments:
>>>> =============================================
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| OPTION             | VALUE                                                                                                                                                 |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| SOURCE_DB          | ['MYSQL', '121.36.15.2', '55444', '', 'root', '******']                                                                                               |
| TARGET_DB          | ['MOGDB', '121.36.15.2', '55432', 'mysql_mtk', 'hongye', '******']                                                                                    |
| WORKERS            | 8                                                                                                                                                     |
| INCLUDE            | [['%', 'MTK', '%']]                                                                                                                                   |
| RESULT_FORMAT      | json                                                                                                                                                  |
| FUNCTION_DIMENSION | {'AVG': {'TYPE': 'A', 'FUNCTIONS': {'*': 'AVG'}}, 'MIN': {'TYPE': 'NP', 'FUNCTIONS': {'*': 'MIN'}}, 'MAX': {'TYPE': 'NP', 'FUNCTIONS': {'*': 'MAX'}}} |
| CATAGORY           | ALL                                                                                                                                                   |
+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+

>>>> =============================================
>>>> 2. Summary:
>>>> =============================================
+-----------------------+-------+
| OPTION                | VALUE |
+-----------------------+-------+
| TOTAL_OBJECTS         | 22    |
| DIFF_OBJECTS          | 10    |
| TOTAL_TABLES          | 9     |
| STRUCTURE_DIFF_TABLES | 1     |
| DATA_DIFF_TABLES      | 2     |
+-----------------------+-------+

>>>> =============================================
>>>> 3. Object Differences:
>>>> =============================================
+-------------+-------------------+------------------+
| OBJECT_TYPE | SOURCE_EXTRA      | TARGET_EXTRA     |
+-------------+-------------------+------------------+
| TABLE       | MTK.MTK_TEST      |                  |
|             | MTK.MTK_TEST_1    |                  |
|             | MTK.MTK_TEST_2    |                  |
|             | MTK.MTK_TEST_3    |                  |
|             | MTK.MTK_TEST_4    |                  |
| TRIGGER     | MTK.USER_LOG      |                  |
| PROCEDURE   | MTK.TEST_MTK_DATA |                  |
|             | MTK.TEST_MTK_TEST |                  |
| SEQUENCE    |                   | MTK.SEQ_LOGS_ID  |
|             |                   | MTK.SEQ_USERS_ID |
+-------------+-------------------+------------------+

>>>> =============================================
>>>> 4. Table Structure Differences:
>>>> =============================================
+-------+---------------+-----------------+---------+--------+--------+
| OWNER | TABLE         | TYPE            | NAME    | SOURCE | TARGET |
+-------+---------------+-----------------+---------+--------+--------+
| MTK   | TEST_VARCHAR3 | COLUMN_NULLABLE | ID      | Y      | N      |
| MTK   | TEST_VARCHAR3 | CONSTRAINT      | PRIMARY |        | ID     |
| MTK   | TEST_VARCHAR3 | INDEX           |         |        | ID     |
+-------+---------------+-----------------+---------+--------+--------+

>>>> =============================================
>>>> 5. Table Data Differences (MD5 ROW-BY-ROW):
>>>> =============================================
+-------+----------------+--------+-------------+-------------+-------------+-------------+----------------------------------+----------------------------------+--------------+
| OWNER | TABLE          | Method | SOURCE_ROWS | TARGET_ROWS | SOURCE_DIFF | TARGET_DIFF |         SOURCE_SIGNATURE         |         TARGET_SIGNATURE         | CHECK_RESULT |
+-------+----------------+--------+-------------+-------------+-------------+-------------+----------------------------------+----------------------------------+--------------+
| mtk   | bug_1005673    | Normal |           7 |           0 |             |             | 8040db9b7ea88fea4edd7e30fe0b3992 | d41d8cd98f00b204e9800998ecf8427e |    FAILED    |
| mtk   | tab_data_check | Normal |          22 |           0 |             |             | 05c4b8258de107a422a12247a09f8326 | d41d8cd98f00b204e9800998ecf8427e |    FAILED    |
+-------+----------------+--------+-------------+-------------+-------------+-------------+----------------------------------+----------------------------------+--------------+

>>>> =============================================
>>>> 6. Completed
>>>> =============================================

Environment

Environment parameters and variables show the program parameters and variables during running.

Object Difference

The object difference result obtained based on the source and target databases can be categorized into three types shown in three columns.

  • OBJECT_TYPE: indicates the type of a difference object.
  • SOURCE_EXTRA: indicates the extra objects of a source database, which are displayed in a list. Each row contains an object, and the list is ordered by NAME.
  • TARGET_EXTRA: indicates the extra objects of a target database, which are displayed in a list. Each row contains an object, and the list is ordered by NAME.

Table Structure Difference

The table structure difference table shows each difference item. The table structure difference result can be categorized into five types shown in five columns.

  • OWNER: indicates the table schema.
  • TABLE_NAME: indicates the name of a table.
  • TYPE: indicates the difference type, including COLUMN_COUNT, COLUMN, COLUMN_POSITION, COLUMN_DATATYPE, COLUMN_NULLABLE, CONSTRAINT, and INDEX.
  • NAME: indicates the name of a difference. The name of a difference varies depending on the difference category.
  • SOURCE: indicates the difference value of a source database. Difference values vary from type to type.
  • TARGET: indicates the difference value of a target database. Difference values vary from type to type.

Note

For constraints with different names, it is not considered that they are different from each other. Two constraints can be considered the same only when their field names, positions, and sequences are consistent or the information about whether to use a function is consistent. This rule also applies to indexes.

For example, the following two indexes are considered the same.

-- Oracle
create index idx_test_pk_oracle on hongye.test(id);
-- MogDB
create index idx_test_pk_mogdb on hongye.test(id);

Table Data Difference

Only data with difference is displayed, or user can use option "--detail-mode" to display the result for all compared tables.

The comparison result can be categorized into 10 types shown in four columns.

  • OWNER: indicates the table schema.
  • NAME: indicates the name of a table.
  • MODE: Compare Mode, can be: Normal, Partition, Sample, Split, Partial
  • SOURCE_ROWS: indicates the number of total rows of a source database.
  • TARGET_ROWS: indicates the number of total rows of a target database.
  • SOURCE_DIFF: indicates the number of difference rows in a source database (It refers to the number of rows that exist in a source database and are different from those in a target database.)
  • TARGET_DIFF: indicates the number of difference rows in a target database (It refers to the number of rows that exist in a target database and are different from those in a source database.)
  • SOURCE_SIGNATURE: indicates source summary signature
  • TARGET_SIGNATURE: indicates target summary signature
  • CHECK_RESULT: Whether data comparison is passed (SUCCEED/FAILED)
Copyright © 2011-2024 www.enmotech.com All rights reserved.