Updated on 2022-09-21 GMT+08:00

Comparing DR Items

You can check the data consistency by comparing DR items in the service and DR databases. DR supports object-level and data-level comparisons.

  • Object-level comparison: compares databases, events, indexes, tables, views, stored procedures, functions, and triggers.
  • Data-level comparison: compares rows and values of tables. To ensure that the comparison results are valid, compare data during off-peak hours by select Start at a specified time or compare data that is rarely accessed or modified.
  • Account comparison: compares the account names and permissions of the source and destination databases.
  • If you modify data in the DR database, the data comparison results may be inaccurate.
  • To prevent resources from being occupied for a long time, DRS limits the row comparison duration. If the row comparison duration exceeds the threshold, the row comparison task stops automatically. If the source database is a relational database, the row comparison duration is 60 minutes. If the source database is a non-relational database, the row comparison duration is 30 minutes.
Table 1 Supported comparison mode

DR Direction

Data Flow

Object-level Comparison

Row Comparison

Value Comparison

Account-level Comparison

Current cloud as standby

MySQL->MySQL

Yes

Yes

Yes

Yes

Current cloud as active

MySQL->MySQL

Yes

Yes

Yes

Yes

Current cloud as standby

MySQL -> GaussDB(for MySQL) primary/standby

Yes

Yes

Yes

Yes

Current cloud as standby

DDM -> DDM

Yes

Yes

No

No

Current cloud as active

DDM -> DDM

Yes

Yes

No

No

Current cloud as standby

GaussDB(for MySQL) primary/standby -> GaussDB(for MySQL) primary/standby

Yes

Yes

Yes

Yes

Current cloud as active

GaussDB(for MySQL) primary/standby -> GaussDB(for MySQL) primary/standby

Yes

Yes

Yes

Yes

Dual-Active DR

MySQL->MySQL

Yes

Yes

Yes

Yes

Dual-Active DR

GaussDB(for MySQL) primary/standby -> GaussDB(for MySQL) primary/standby

Yes

Yes

Yes

Yes

Prerequisites

You have logged in to the DRS console.

Procedure

  1. On the Disaster Recovery Management page, click the target DR task in the Task Name/ID column.
  2. On the Disaster Recovery Comparison tab, compare the service and DR databases.

    1. Check the integrity of the database object.
      Click Validate Objects. On the Object-Level Comparison tab, click Compare. Wait for a while and click , and view the comparison result of each comparison item.
      Figure 1 Comparing objects

      Locate a comparison item you want to view and click View Details in the Operation column.

    2. After the check is complete, compare the number of rows and values.

      On the Data-Level Comparison tab, click Create Comparison Task. In the displayed dialog box, specify Compute Method, Comparison Type, Comparison Time, and Object. Then, click OK.

      Figure 2 Creating a comparison task
      • Comparison Type: compares rows and values.
      • Comparison Method: DRS provides static and dynamic comparison methods.
        • Static: All data in the source and destination databases is compared. The comparison task ends as the comparison is completed. Static comparison can only be performed when there are no ongoing services.
        • Dynamic: All data in the source database is compared with that in the destination database. After the comparison task is complete, incremental data in the source and destination databases is compared in real time. A dynamic comparison can be performed when data is changing.

          Currently, only MySQL and GaussDB(for MySQL) support the comparison mode.

      • Comparison Time: You can select Start upon task creation or Start at a specified time. There is a slight difference in time between the source and destination databases during synchronization. Data inconsistency may occur. You are advised to compare migration items during off-peak hours for more accurate results.
      • Object: You can select objects to be compared based on the scenarios.
      • Data-level comparison cannot be performed for tasks in initialization.
    3. After the comparison creation task is submitted, the Data-Level Comparison tab is displayed. Click to refresh the list and view the comparison result of the specified comparison type.
      Figure 3 Viewing the data-level comparison result
    4. To view the comparison details, locate the target comparison type and click View Results in the Operation column. On the displayed page, locate a pair of service and DR databases, and click View Details in the Operation column to view detailed comparison results.
      Figure 4 Viewing comparison details

      You can also view comparison details of canceled comparison tasks.

    5. Check the database accounts and permissions. Click the Account-Level Comparison tab to view the comparison results of database accounts and permissions.
      Figure 5 Account-level comparison
      • Account comparison cannot be performed for tasks in the initialization phase.