Before you can use the lock-free schema change feature of Data Management (DMS), you must enable it for the target instance. This topic describes the procedure.
Prerequisites
The database is one of the following types: ApsaraDB RDS for MySQL, PolarDB for MySQL, MyBase for MySQL, or a self-managed MySQL database.
The instance is managed in Stable Change or Security Collaboration control mode. For more information, see View the control mode of an instance.
You have the permissions of a database administrator (DBA) or a DMS administrator. For more information about how to view your role, see View my system roles.
Procedure
- Log on to the DMS console V5.0.
On the home page, in the Database Instances list, right-click the target instance and select Enable Lock-free Schema Change.
NoteAlternatively, in the top menu bar, choose . On the instance list tab, click to the right of the target instance. Then, enable lock-free schema change in the Advanced Information section.

Modification methods:
Option
Execution description
Remarks
DMS lock-free change execution
Directly uses the self-developed DMS lock-free DDL engine to ensure that tables are not locked.
NoteDMS lock-free change cannot be used in the following cases. The system automatically falls back to native lock-free execution. If DMS detects that native lock-free execution will lock a table or cause an error, the task fails.
The target table is empty. Executing a statement on an empty table is risk-free, and native execution is faster.
The SQL statement adds a UNIQUE constraint (UK). Due to the design of the DMS lock-free schema change feature, adding a UK is not supported.
The running time is slower than native MySQL Online DDL, but it does not affect replication and has a low probability of causing latency.
Native lock-free first, fallback to DMS on failure
The system first tries to use the database's native Online DDL for lock-free execution. If DMS detects that native execution will lock a table or fail, it automatically switches to the self-developed DMS lock-free DDL engine to ensure that tables are not locked.
The running time is relatively fast, but it may cause parallel replication on the instance to degrade to serial replication. This can lead to primary/standby latency.
Off
Native statements are sent to MySQL for execution without any processing.
None
In the Modify Lock-free Schema Change dialog box, click Confirm.
After you enable the lock-free schema change feature, you can use a lock-free change ticket to change a table schema.
Related operations
After you enable the lock-free schema change feature for an instance, DMS prioritizes this method for the following types of tickets:
- Note
This refers to schema changes that are executed using Data Change tickets.