To use the lock-free schema change feature provided by Data Management (DMS), you must enable this feature for the specified database instance. This topic describes how to enable the lock-free schema change feature.

Prerequisites

  • The database type is ApsaraDB RDS for MySQL, PolarDB for MySQL, MyBase for MySQL, or MySQL database from other sources.
  • The database instance is managed in Stable Change or Security Collaboration mode in DMS. For more information, see View the control mode of an instance.
  • You are a database administrator (DBA) or a DMS administrator. For more information about how to view the role of a user, see View owned system roles.

Procedure

  1. Log on to the DMS console V5.0.
  2. In the top navigation bar, click Data Assets. In the left-side navigation pane, click Instance.
  3. Find the database instance for which you want to enable the lock-free schema change feature, move the pointer over More in the Actions column, and then select Edit.
    Note Alternatively, you can click the SQL Console tab in the top navigation bar. Then, find the database instance for which you want to enable the lock-free schema change feature in the left-side navigation pane. Right-click the database instance and select Edit.
  4. Click Advanced Information.
  5. In the Lock-free Schema Change drop-down list, select Open (DMS OnlineDDL first) or Open (MySQL Native OnlineDDL first).
    Option Description Remarks
    Open (DMS OnlineDDL first) DMS uses its own lock-free DDL feature to ensure that schemas can be changed without the need to lock tables. The schema change takes longer than it takes by using native online DDL operations of MySQL. However, this feature does not affect data copy and generates no latency.
    Open (MySQL Native OnlineDDL first) DMS preferentially uses native online DDL operations of MySQL to change schemas. If tables are locked in this case, DMS uses the lock-free DDL feature to change schemas. This ensures that tables are not locked. The schema change is faster, but parallel threads for replication may become serial threads. This leads to synchronization latency between primary and secondary databases.
    Close DMS routes SQL statements to the MySQL database for execution. In this case, DMS does not process the statements. N/A
  6. Click Submit.
    After you enable the lock-free schema change feature for the specified database instance, DMS preferentially applies this feature when you submit the following types of tickets: