Updated on 2024-06-07 GMT+08:00

From Oracle to MySQL

Supported Source and Destination Databases

Table 1 Supported databases

Source DB

Destination DB

  • On-premises databases (Oracle 10g, 11g, 12c, 18c, 19c, and 21c)
  • Self-built databases on ECS (Oracle 10g, 11g, 12c, 18c, 19c, and 21c)
  • RDS for MySQL

Supported Synchronization Objects

Table 2 lists the objects that can be synchronized in different scenarios. DRS will automatically check the objects you selected before the synchronization.

Table 2 Supported synchronization objects

Type

Precautions

Objects

  • Object level: table level, object file import,
  • Supported synchronization objects:
    • Databases, table structures, primary keys, unique keys, normal indexes, and table data can be synchronized. Other database objects, such as stored procedures, triggers, functions, sequences, packages, synonyms, and users, cannot be synchronized.
    • In the full synchronization phase, bfile, xml, sdo_geometry, urowid, interval (precision greater than 6 digits), and user-defined types are not supported.
    • In the incremental synchronization phase, bfile, xml, interval, sdo_geometry, urowid, timestamp (precision greater than 6 digits), and user-defined types are not supported.
    • During the incremental synchronization, if the source database is a physical standby Oracle database, data of the LOB type cannot be parsed (the data dictionary cannot be generated). If the table to be synchronized contains data of the LOB type, the incremental synchronization will fail.
    • In the incremental phase, Oracle extended characters are not supported. The standard character set cannot parse Oracle customized extended characters.
    • Objects that have dependencies must be synchronized at the same time to avoid synchronization failure. Common dependencies: tables referenced by primary or foreign keys
    • Partitions in the table structure cannot be synchronized. Partitioned tables are changed to non-partitioned tables after being synchronized to the destination database.
    • Tables whose default values contain expression functions cannot be synchronized.
    • Temporary tables in the source database cannot be synchronized.
    • An empty source database cannot be synchronized.
    • Tables with virtual columns in the source database cannot be synchronized.
    • If the table contains only LOB columns, data inconsistency may occur.
    • If the empty function of the LOB type is used to write data in the Oracle database, the value queried through JDBC is an empty string. Whether the value is an empty string or NULL after being written to the destination database depends on the processing of the empty string in the destination database.
    • For a table that does not have a primary key or index, the number of columns of non-large fields must be greater than 3. Otherwise, incremental synchronization may fail because all columns cannot be matched.
    NOTE:
    • Database object names, such as the database name and table name, support English characters and symbols such as #, $, and _. DRS does not support non-ASCII characters or special characters .>`<'\,|?!"
    • Object names will be converted to lowercase letters after being synchronized to the destination database. To avoid synchronization failures, ensure that the selected source database tables do not contain tables with the same name but different letter cases.

Database Account Permission Requirements

To start a synchronization task, the source and destination database users must meet the requirements in the following table. Different types of synchronization tasks require different permissions. For details, see Table 3. DRS automatically checks the database account permissions in the pre-check phase and provides handling suggestions.

  • You are advised to create an independent database account for DRS task connection to prevent task failures caused by database account password modification.
  • After changing the account passwords for the source and destination databases, modify the connection information in the DRS task as soon as possible to prevent automatic retry after a task failure. Automatic retry will lock the database accounts.
Table 3 Database account permission

Type

Full

Incremental and Full+Incremental

Source database user

CREATE SESSION, SELECT ANY DICTIONARY, and SELECT for a single table (GRANT SELECT ON <userName.tbName> to drsUser)

  • Oracle 12c or later in tenant mode:
    • To synchronize a container database (CDB) of Oracle 12c or later, you must have the following permissions: CREATE SESSION, SELECT ANY DICTIONARY, SELECT for a single table (GRANT SELECT ON <userName.tbName> to drsUser), EXECUTE_CATALOG_ROLE, SELECT ANY TRANSACTION, and LOGMINING.
    • To synchronize a pluggable database (PDB) of Oracle 12c or later, you must have the following permissions: CREATE SESSION, SELECT ANY DICTIONARY, SELECT for a single table (GRANT SELECT ON <userName.tbName> to drsUser), EXECUTE_CATALOG_ROLE and SELECT ANY TRANSACTION permissions for a PDB, and CREATE SESSION, SELECT ANY DICTIONARY, EXECUTE_CATALOG_ROLE, SELECT ANY TRANSACTION, LOGMINING and SET CONTAINER (GRANT SET CONTAINER TO <userName> CONTAINER=ALL) permissions for a CDB.
  • Oracle 12c or later in non-tenant mode:

    You must have the following permissions: CREATE SESSION, SELECT ANY DICTIONARY, SELECT for a single table (GRANT SELECT ON <userName.tbName> to drsUser), EXECUTE_CATALOG_ROLE, SELECT ANY TRANSACTION, and LOGMINING.

  • To synchronize a database of Oracle 11g or earlier, you must have the following permissions: CREATE SESSION, SELECT ANY DICTIONARY, SELECT for a single table (GRANT SELECT ON <userName.tbName> to drsUser), EXECUTE_CATALOG_ROLE, and SELECT ANY TRANSACTION.
  • During incremental synchronization, enable PK, UI, or ALL supplemental logging for the source Oracle database at the database level or table level. If supplemental logging is enabled at table level, enable supplemental logging again after you rebuild or rename tables. During the synchronization, ensure that the preceding settings are always enabled.
  • Oracle 12c or later does not support incremental synchronization using accounts whose ORACLE_MAINTAINED is Y (except system/sys), because accounts with this attribute do not have the permission to parse logs.

Destination database user

The user must have the SELECT, INSERT, CREATE, DROP, UPDATE, ALTER, DELETE and INDEX permissions.

Suggestions

  • When a task is being started or in the full synchronization phase, do not perform DDL operations on the source database. Otherwise, the task may be abnormal.
  • To keep data consistency before and after the synchronization, ensure that no data is written to the destination database during the synchronization.
  • The success of database synchronization depends on environment and manual operations. To ensure a smooth synchronization, perform a synchronization trial before you start the synchronization to help you detect and resolve problems in advance.
  • You are advised to start your synchronization task during off-peak hours by setting Start Time to Start at a specified time. A less active database is easier to synchronize successfully. If the data is fairly static, there is less likely to be any severe performance impacts during the synchronization.
    • If network bandwidth is not limited, the query rate of the source database increases by about 50 MB/s during full synchronization, and two to four CPUs are occupied.
    • The data being synchronized may be locked by other transactions for a long period of time, resulting in read timeout.
    • When DRS concurrently reads data from a database, it will use about 6 to 10 sessions. The impact of the connections on services must be considered.
    • If you read a table, especially a large table, during the full migration, the exclusive lock on that table may be blocked.
    • For more information about the impact of DRS on databases, see How Does DRS Affect the Source and Destination Databases?
  • Data-Level Comparison

    To obtain accurate comparison results, compare data at a specified time point during off-peak hours. If it is needed, select Start at a specified time for Comparison Time. Due to slight time difference and continuous operations on data, data inconsistency may occur, reducing the reliability and validity of the comparison results.

Precautions

The full+incremental synchronization process consists of four phases: task startup, full synchronization, incremental synchronization, and task completion. A single full synchronization task contains three phases. To ensure smooth synchronization, read the following notes before creating a synchronization task.

Table 4 Precautions

Type

Restrictions

Starting a task

  • Source database parameter requirements:
    • Only the following character sets are supported: ZHS16GBK, AL32UTF8, UTF8, US7ASCII, WE8MSWIN1252, WE8ISO8859P1, WE8ISO8859P2, WE8ISO8859P4, WE8ISO8859P5, WE8ISO8859P7, WE8ISO8859P9, WE8ISO8859P13, WE8ISO8859P15.
  • Source database object requirements:
    • The source database name or mapped name cannot start with ib_logfile or be ib_buffer_pool, ib_doublewrite, ibdata1 or ibtmp1.
    • The default values of the source database can be to_date and sys_guid functions. To use other functions as default values, ensure that the destination database has the same functions. If the destination database does not have the corresponding function, the following results may be displayed:

      The default value may be left empty.

      The table fails to be created. As a result, the object comparison result is inconsistent or the task fails.

    • The maximum row length of Oracle cannot exceed 8 KB, excluding BLOB and TEXT columns which will be automatically converted to the text and blob types of MySQL. The reason is that the MySQL InnoDB restricts the row length to 8 KB.
    • The primary key or unique key column cannot contain values of the string data type when you map the MySQL data types to the character data types in Oracle because MySQL cannot tell spaces in data. Otherwise, data inconsistency and deadlock may occur.
    • The values of binary_float and binary_double cannot be set to Nan, Inf, or -Inf because MySQL does not support these values. DRS converts the three values to 0 and saves them by default.
    • MySQL does not support the synchronization of the check constraints of Oracle.
    • AUTO_PK_ROW_ID cannot be used as a column name in Oracle because it is a reserved column name in MySQL 5.7 and cannot be created.
    • Ensure that the precision of the number(p, s) field in the Oracle database does not exceed the precision range p: [1, 38], s:[p-65, min(p, 30)]. The value of s depends on the value of p. The lower limit is p-65, and the upper limit is the minimum value of p or 30. For example, when p is 1, the value range of s is [-64, 1]. When p is 38, the value range of s is [-27, 30]. The value of the int field cannot exceed the precision range of (65, 0). The digit range of MySQL is smaller than that of Oracle.
    • The precision of the float(p) field in the Oracle database cannot exceed the precision range p: [1, 32]. The float range of MySQL is smaller than that of Oracle.
    • The size of an Oracle archive log file must be greater than the maximum size of a single data record to prevent incremental data parsing exceptions caused by cross-file (more than two log files) of a single data record.
    • The total index length of columns in the source database cannot exceed the length limit in the destination database. For detailed length requirements, see Index Length Description.
    • The Default User statement is not supported in MySQL.
  • Destination database parameter requirements:
    • During a synchronization, a large amount of data is written to the destination database. If the value of the max_allowed_packet parameter of the destination database is too small, data cannot be written. You are advised to set the max_allowed_packet parameter to a value greater than 100 MB.
  • Destination database object requirements:
    • The time zone settings of the source and destination database must be the same.
    • When you select to synchronize the table structure, the destination instance cannot contain the database to be synchronized.
    • The storage of the destination database should be about 1.5 times greater than the storage of the source database.
    • If the destination database version is earlier than 5.7.7, the index column length cannot exceed 767 bytes. If the destination database version is later than 5.7.7, the length cannot exceed 3072 bytes.
    • Do not use foreign keys for tables during synchronization. Otherwise, the sequence of writing data to different tables may be inconsistent with that in the source database, which may trigger foreign key constraints and cause synchronization failures.
    • The destination table can contain more columns than the source table. However, the following failures must be avoided:

      Assume that extra columns on the destination cannot be null or have default values. If newly inserted data records are synchronized from the source to the destination, the extra columns will become null, which does not meet the requirements of the destination and will cause the task to fail.

      Assume that extra columns on the destination must be fixed at a default value and have a unique constraint. If newly inserted data records are synchronized from the source to the destination, the extra columns will contain multiple default values. That does not meet the unique constraint of the destination and will cause the task to fail.

  • Other notes:
    • If the data types are incompatible, the synchronization may fail.
    • The table without a primary key lacks a unique identifier for rows. When the network is unstable, you may need to retry the task several times, or data inconsistency may occur.
    • If there are special characters such as Chinese and Japanese in the Oracle database, the code of the destination Oracle database must be the same as the code of the source Oracle database. Otherwise, garbled characters are displayed in the destination database.
    • Before creating a DRS task, if concurrency control rules of SQL statements are configured for the destination database, the DRS task may fail.
    • If the length of a table structure in the Oracle database exceeds 65,535 bytes, the synchronization may fail. The length of a table structure is the total length of all columns. The length of the char or varchar2 type is related to the code.
    • After the Oracle table structure is synchronized to the MySQL database, the character set of the table is UTF8MB4.
    • If the Oracle character set is WE8MSWIN1252, the CLOB column synchronized to the destination database may contain garbled characters. You can change the character set of the source database to AL32UTF8 before the synchronization.
    • If the PDB database is used for synchronization, all PDBs must be enabled during incremental synchronization due to the restrictions of the Oracle LogMiner component.
    • In Oracle 12.2 and later versions, due to the restrictions of the Oracle LogMiner component, a schema, table, or column name contains no more than 30 characters during an incremental synchronization.
    • For an Oracle RAC cluster, use the scan IP address and service name to create a task. The SCAN IP address can provide better fault tolerance, load capability, and synchronization experience.
    • If the source is an Oracle RAC database and the SCAN IP address is used to configure a DRS task, ensure that the SCAN IP address and DRS node IP address can communicate with all virtual IP addresses of the source database. Otherwise, the connectivity check fails. If the SCAN IP address is not used, the virtual IP address of a node can be used. In this case, DRS logs are parsed only on the RAC node specified by the virtual IP address.
    • There are some syntax differences between Oracle and MySQL, so the syntax including but not limited to functions, expressions, and referenced system tables, may not be completely converted during the structure synchronization. Therefore, during the synchronization, the structure may exist in the Oracle database but does not exist in the MySQL database, or the syntax exists in the MySQL database but is not converted. As a result, the structure fails to be synchronized. If this happens, you can manually create a table structure in the destination database.
    • You can enable strong consistency during synchronization to ensure that the commit sequence and atomicity of transactions synchronized to the destination database are the same as those of the source database. However, the performance in this mode is much lower than that in the default mode.
    • When strong consistency is enabled, out-of-memory (OOM) may occur if the size of committed transactions is greater than 256 MB.
    • In a full+incremental or incremental synchronization, the PDB database cannot be directly connected. You need to provide the service name/SID, username, and password of the CDB.
    • You are not advised to use the LOB type and extended character type (the length exceeds 4000 bytes) as incremental data filtering conditions. Oracle logs may not record the old value of update.
    • If the supplemental logging level of the source Oracle database is not set to All and the incremental update data of the source database was not found in the destination database, the complete data of the source database cannot be written to the destination database even if the conflict policy is set to Overwrite. To write all data to the destination database, set the supplemental logging level of the source database to All.

Full synchronization

  • When a DRS task is being started or in the full synchronization phase, do not perform DDL operations on the source database. Otherwise, the task may be abnormal.
  • During a full synchronization, do not modify or delete the usernames, passwords, permissions, or ports of the source and destination databases.
  • During a full synchronization, do not perform operations (including but not limited to DDL and DML operations) on the destination database.
  • During a full synchronization, do not perform the resetlogs operation on the source Oracle database. Otherwise, data cannot be synchronized and tasks cannot be restored.
  • During a full synchronization, the rollback operation of the LOB type is not supported. Otherwise, the synchronization task fails.
  • During a full synchronization, the username (schema name) of the source Oracle database cannot be changed, including the scenarios where the schema name is changed by modifying the USER$ dictionary table in versions earlier than 11.2.0.2 and by using ALTER USER username RENAME TO new_username in versions later than 11.2.0.2.
  • In a full synchronization for the table structure, the length of the char and varchar2 characters in the source database is automatically increased by at least 1.5 times by byte in the destination database (because the length of the destination database is in the unit of byte). The increase multiple depends on the character set of the source and destination databases. For example, if the character set is UTF8, increase the length (byte) by three times by default. If the character set is GBK, increase the length (byte) by two times by default.
  • When the structure of a partitioned table is synchronized during a full synchronization, the partitioned table is converted to a non-partitioned table. During incremental synchronization, operations on partitioned tables in the source database may fail to be synchronized to the destination database or fail to be executed in the destination database.
  • During full data synchronization, a lot of binlogs are generated in the destination database, occupying too much storage space. Therefore, during full data synchronization, only the latest five binlogs are retained in the destination database by default. After the full synchronization is complete, the retention period of binlogs in the destination database is restored to the value you configure. If you want to keep the binlog retention period of the destination database to be the value you specify due to service requirements, you need to submit a service ticket. In the upper right corner of the management console, choose Service Tickets > Create Service Ticket to submit a service ticket.

Incremental synchronization

  • During an incremental synchronization, do not modify or delete the usernames, passwords, permissions, or ports of the source and destination databases.
  • During an incremental synchronization, do not perform operations (including but not limited to DDL and DML operations) on the destination database.
  • During an incremental synchronization, do not perform the resetlogs operation on the source Oracle database. Otherwise, data cannot be synchronized and tasks cannot be restored.
  • During an incremental synchronization, the rollback operation of the LOB type is not supported. Otherwise, the synchronization task fails.
  • During an incremental synchronization, the username (schema name) of the source Oracle database cannot be changed, including the scenarios where the schema name is changed by modifying the USER$ dictionary table in versions earlier than 11.2.0.2 and by using ALTER USER username RENAME TO new_username in versions later than 11.2.0.2.
  • During an incremental synchronization, do not change the char field in the source database or destination database table to varchar, or it is padded with extra spaces due to diffrences between Oracle and MySQL. In this case, data inconsistency may occur.
  • During an incremental synchronization, some DDL operations are supported. DDL conversion of heterogeneous databases requires semantic analysis and syntax compatibility. Only some DDL operations can be synchronized when the conversion is successful and the following conditions are met. If a task is abnormal due to DDL synchronization in other cases, you need to manually execute the DDL operations in the destination database.
    • Table-level synchronization supports alter table add column, alter table drop column, alter table rename column, alter table modify column, and truncate table. The modification of default values is not supported.
    • Database-level synchronization supports create table. (Table definitions cannot contain functions.)
    • The object in DDL cannot be the keyword of the destination database, such as index or where. For details about keywords of the destination MySQL database, see MySQL official documentation.
    • If the destination database version is earlier than 8.0, alter table rename column is not supported.
    • Incremental DDL operations do not support special characters such as full-width and Chinese characters.
  • During an incremental synchronization, 0x00 at the end of BLOB and the spaces at the end of CLOB are truncated.
  • During incremental synchronization, you are not advised to select a hybrid partition table because DML logs are not generated when data in the external partition of the hybrid partition table changes. DRS cannot obtain the changes during incremental synchronization, which may cause data inconsistency.
  • During incremental synchronization, the incremental parsing supports only data within the valid range of the Oracle time type. Data beyond the valid range may cause task exceptions. For example, data truncation occurs if the year value is greater than 9999.
  • If the source is an RAC database, all RAC nodes must be online when incremental synchronization is started for the first time. Otherwise, an error occurs during incremental synchronization.
  • If the source is an RAC database, the number of nodes cannot be increased or decreased during incremental synchronization to avoid incremental synchronization exceptions and ensure strong data consistency.
  • Table names are converted to lowercase letters after the tables are synchronized to the destination database. For example, ABC is converted to abc. In incremental synchronization, the source database cannot contain tables with the same name but different letter cases. Otherwise, the synchronization will fail.
  • When editing the task to add a new table, ensure that transactions of the new table have been committed. Otherwise, transactions that are not committed may fail to be synchronized to the destination database. You are advised to add tables during off-peak hours.

Procedure

This section uses real-time synchronization from Oracle to RDS for MySQL as an example to describe how to configure a real-time synchronization task.

  1. On the Data Synchronization Management page, click Create Synchronization Task.
  2. On the Create Synchronization Instance page, select a region and project, specify the task name, description, and the synchronization instance details, and click Create Now.

    • Task information description
      Figure 1 Synchronization task information
      Table 5 Task information

      Parameter

      Description

      Region

      The region where the replication instance is deployed. You can change the region.

      Project

      The project corresponds to the current region and can be changed.

      Task Name

      The task name must start with a letter and consist of 4 to 50 characters. It can contain only letters, digits, hyphens (-), and underscores (_).

      Description

      The description consists of a maximum of 256 characters and cannot contain special characters !=<>'&"\

    • Synchronization instance details
      Figure 2 Synchronization instance details
      Table 6 Synchronization instance information

      Parameter

      Description

      Data Flow

      Select To the cloud.

      Source DB Engine

      Select Oracle.

      Destination DB Engine

      Select MySQL.

      Network Type

      Public network is used as an example. Available options: VPC, Public network and VPN or Direct Connect

      • VPC is suitable for data synchronization between cloud databases of the same account in the same region.
      • Public network is suitable for data synchronization from on-premises or external cloud databases to the destination databases bound with an EIP.
      • VPN or Direct Connect is suitable for synchronization of data between on-premises databases and cloud databases, between cloud databases of different accounts in the same region, or between cloud databases across regions.

      Destination DB Instance

      The RDS for MySQL instance you created.

      Synchronization Instance Subnet

      Select the subnet where the synchronization instance is located. You can also click View Subnets to go to the network console to view the subnet where the instance resides.

      By default, the DRS instance and the destination DB instance are in the same subnet. You need to select the subnet where the DRS instance resides, and there are available IP addresses for the subnet. To ensure that the synchronization instance is successfully created, only subnets with DHCP enabled are displayed.

      Synchronization Mode

      The synchronization mode supported by a DRS task. Full+Incremental is used as an example. For details about the underlying working principles for full or incremental synchronization, see Product Architecture and Function Principles.

      • Full+Incremental

        This synchronization mode allows you to synchronize data in real time. After a full synchronization initializes the destination database, an incremental synchronization parses logs to ensure data consistency between the source and destination databases.

        NOTE:

        If you select Full+Incremental, data generated during the full synchronization will be continuously synchronized to the destination database, and the source remains accessible.

      • Full

        All database objects and data you selected are synchronized to the destination database at a time. This mode is applicable to scenarios where service interruption is acceptable.

      • Incremental

        Through log parsing, incremental data generated on the source database is synchronized to the destination database.

      Specify EIP

      This parameter is available when you select Public network for Network Type. Select an EIP to be bound to the DRS instance. DRS will automatically bind the specified EIP to the DRS instance and unbind the EIP after the task is complete.

      For details about the data transfer fee generated using a public network, see EIP Price Calculator.

    • Task type
      Figure 3 Task type
      Table 7 Task type information

      Parameter

      Description

      Specifications

      DRS instance specifications. Different specifications have different performance upper limits. For details, see Real-Time Synchronization.

      NOTE:

      DRS allows you to upgrade specifications only for single-AZ synchronization tasks. Task specifications cannot be downgraded. For details, see Changing Specifications.

      AZ

      Select the AZ where you want to create the DRS task. Selecting the one housing the source or destination database can provide better performance.

    • Enterprise Project and Tags
      Figure 4 Enterprise projects and tags
      Table 8 Enterprise Project and Tags

      Parameter

      Description

      Enterprise Project

      An enterprise project you would like to use to centrally manage your cloud resources and members. Select an enterprise project from the drop-down list. The default project is default.

      For more information about enterprise project, see Enterprise Management User Guide.

      To customize an enterprise project, click Enterprise in the upper right corner of the console. The Enterprise Project Management Service page is displayed. For details, see Creating an Enterprise Project in Enterprise Management User Guide.

      Tags

      • Tags a task. This configuration is optional. Adding tags helps you better identify and manage your tasks. Each task can have up to 20 tags.
      • If your organization has configured tag policies for DRS, add tags to tasks based on the policies. If a tag does not comply with the policies, task creation may fail. Contact your organization administrator to learn more about tag policies.
      • After a task is created, you can view its tag details on the Tags tab. For details, see Tag Management.

    If a task fails to be created, DRS retains the task for three days by default. After three days, the task automatically stops.

  3. On the Configure Source and Destination Databases page, wait until the synchronization instance is created. Then, specify source and destination database information and click Test Connection for both the source and destination databases to check whether they have been connected to the synchronization instance. After the connection tests are successful, select the check box before the agreement and click Next.

    Figure 5 Source database information
    Table 9 Source database settings

    Parameter

    Description

    IP Address or Domain Name

    The IP address or domain name of the source database.

    NOTE:

    For a RAC cluster, use a Scan IP address to improve access performance.

    Port

    The port of the source database. Range: 1 – 65535

    Database Service Name

    Enter a database service name (Service Name/SID). The client can connect to the Oracle database through the database service name. For details about how to query the database service name, see the prompt on the GUI.

    PDB Name

    Container database (CDB) and pluggable database (PDB) are new features in Oracle 12c and later versions. This function is optional, but it must be enabled if you want to migrate only PDB tables.

    Enter the service name, SID, username, and password of the CDB that contains the PDB tables to be migrated.

    Database Username

    The username for accessing the source database.

    Database Password

    The password for the database username.

    SSL Connection

    If SSL connection is required, enable SSL on the source database, ensure that related parameters have been correctly configured, and upload an SSL certificate.

    NOTE:
    • The maximum size of a single certificate file that can be uploaded is 500 KB.
    • If SSL is disabled, your data may be at risk.

    The IP address, domain name, username, and password of the source database are encrypted and stored in DRS, and will be cleared after the task is deleted.

    Figure 6 Destination database information
    Table 10 Destination database settings

    Parameter

    Description

    DB Instance Name

    The RDS for MySQL instance selected when you created the migration task. The instance cannot be changed.

    Database Username

    The username for accessing the destination database.

    Database Password

    The database username and password are encrypted and stored in the system and will be cleared after the task is deleted. You can change the password if necessary.

    SSL Connection

    If SSL connection is required, enable SSL on the destination database, ensure that related parameters have been correctly configured, and upload an SSL certificate.

    NOTE:
    • The maximum size of a single certificate file that can be uploaded is 500 KB.
    • If SSL is disabled, your data may be at risk.

  4. On the Set Synchronization Task page, select the synchronization object type and synchronization objects, and click Next.

    Figure 7 Synchronization mode

    Table 11 Synchronization mode and object

    Parameter

    Description

    Flow Control

    You can choose whether to control the flow. Flow Control takes effect in the full phase only.

    • Yes

      You can customize the maximum synchronization speed. During the full synchronization, the synchronization speed of each task (or each subtask in multi-task mode) does not exceed the value of this parameter.

      In addition, you can set the time range based on your service requirements. The traffic rate setting usually includes setting of a rate limiting time period and a traffic rate value. Flow can be controlled all day or during specific time ranges. The default value is Always. A maximum of three time ranges can be set, and they cannot overlap.

      The flow rate must be set based on the service scenario and cannot exceed 9,999 MB/s.

      Figure 8 Flow control
    • No
      The synchronization speed is not limited and the outbound bandwidth of the source database is maximally used, which will increase the read burden on the source database. For example, if the outbound bandwidth of the source database is 100 MB/s and 80% bandwidth is used, the I/O consumption on the source database is 80 MB/s.
      NOTE:
      • The flow control mode takes effect only in the full synchronization phase.
      • You can also change the flow control mode after creating a task. For details, see Modifying the Flow Control Mode.

    Sharding Mode

    Select Sharding by primary key or Sharding by row ID as needed.

    • Sharding by primary key

      Tables with primary keys are sharded using primary key values. The sharding efficiency is lower than that of Sharding by row ID.

    • Sharding by row ID

      Sharding by row ID is recommended for synchronizing large tables without primary keys, improving sharding efficiency.

      Restrictions on Sharding by row ID: During full synchronization, do not perform operations that will cause row ID changes on the source database, such as Export/import of the table, ALTER TABLE XXXX MOVE, ALTER TABLE XXXX SHRINK SPACE, FLASHBACK TABLE XXXX, Splitting a partition, Updating a value so that it moves to a new partition, or Combining two partitions. Otherwise, data may be inconsistent. You can run ALTER TABLE XXXX DISABLE ROW MOVEMENT to disable these operations.

    Synchronization Object Type

    You can select Table structure, Data, or Index for Synchronization Object Type for full synchronization.

    • Data is selected by default.
    • If Table structure is selected, the destination database cannot contain tables whose names are the same as the source tables to be synchronized.
    • If Table structure is not selected, the destination database must have tables that match the source tables, and the table structure must be the same as the selected source table structures.

    Strong Consistency

    This option is disabled by default. You can enable it to ensure that the commit sequence and atomicity of transactions synchronized to the destination database are the same as those of the source database. However, the performance in this mode is much lower than that in the default mode.

    Synchronize DML

    Select the DML operations to be synchronized. By default, all DML operations are selected.

    If you do not select Delete, DELETE statements in the incremental data of the source database will not be synchronized, which may cause a data inconsistency. As a result, there may be a data conflict or the task may fail.

    Synchronization Object

    The left pane displays the source database objects, and the right pane displays the selected objects. You can select Tables or Import object file for Synchronization Object as required. To quickly select the desired database objects, you can use the search function.

    NOTE:
    • To quickly select the desired database objects, you can use the search function.
    • If there are changes made to the source databases or objects, click in the upper right corner to update the objects to be synchronized.
    • If an object name contains spaces, the spaces before and after the object name are not displayed. If there are two or more consecutive spaces in the middle of the object name, only one space is displayed.
    • The name of the selected synchronization object cannot contain spaces.

  5. On the Process Data page, filter the data to be synchronized and click Next. For details, see Processing Data.
  6. On the Check Task page, check the synchronization task.

    • If any check fails, review the cause and rectify the fault. After the fault is rectified, click Check Again.

      For details about how to handle check failures, see Solutions to Failed Check Items in Data Replication Service User Guide.

    • If all check items are successful, click Next.

      You can proceed to the next step only when all checks are successful. If there are any items that require confirmation, view and confirm the details first before proceeding to the next step.

  7. On the displayed page, specify Start Time, Send Notifications, SMN Topic, Delay Threshold (s), and Stop Abnormal Tasks After, confirm that the configured information is correct, select the check box before the agreement, and click Submit to submit the task.

    Figure 9 Task startup settings

    Table 12 Task startup settings

    Parameter

    Description

    Start Time

    Set Start Time to Start upon task creation or Start at a specified time based on site requirements.

    NOTE:

    After a synchronization task is started, the performance of the source and destination databases may be affected. You are advised to start a synchronization task during off-peak hours.

    Send Notifications

    This parameter is optional. After enabled, select a SMN topic. If the status, latency metric, or data of the migration task is abnormal, DRS will send you a notification.

    SMN Topic

    This parameter is available only after you enable Send Notifications and create a topic on the SMN console and add a subscriber.

    For details, see Simple Message Notification User Guide.

    Delay Threshold (s)

    During an incremental synchronization, a synchronization delay indicates a time difference (in seconds) of synchronization between the source and destination database.

    If the synchronization delay exceeds the threshold you specify, DRS will send alarms to the specified recipients. The value ranges from 0 to 3,600. To avoid repeated alarms caused by the fluctuation of delay, an alarm is sent only after the delay has exceeded the threshold for six minutes.

    NOTE:
    • If the delay threshold is set to 0, no notifications will be sent to the recipient.
    • In the early stages of an incremental synchronization, the synchronization delay is long because a large quantity of data is awaiting synchronization. In this case, no notifications will be sent.
    • Before setting the delay threshold, enable Send Notifications.

    Data Exception Notification

    This parameter is optional. After enabled, DRS will send a notification if the task data is abnormal.

    Stop Abnormal Tasks After

    Number of days after which an abnormal task is automatically stopped. The value must range from 14 to 100. The default value is 14.

    NOTE:
    • You can set this parameter only for pay-per-use tasks.
    • Tasks in the abnormal state are still charged. If tasks remain in the abnormal state for a long time, they cannot be resumed. Abnormal tasks run longer than the period you set (unit: day) will automatically stop to avoid unnecessary fees.

  8. After the task is submitted, you can view and manage it on the Data Synchronization Management page.

    • You can view the task status. For more information about task status, see Task Statuses.
    • You can click in the upper right corner to view the latest task status.
    • By default, DRS retains a task in the Configuration state for three days. After three days, DRS automatically deletes background resources, but the task status remains unchanged. When you configure the task again, DRS applies for resources for the task again. In this case, the IP address of the DRS instance changes.