All Products
Search
Document Center

Data Management:Get started with lock-free schema change

Last Updated:Jun 21, 2026

The lock-free schema change feature in Data Management Service (DMS) lets you modify table schemas without locking tables. This prevents business interruptions and mitigates primary-standby replication latency from native online DDL operations. This topic uses an ApsaraDB RDS for MySQL instance as an example to show you how to perform a lock-free schema change in DMS.

Add instance and enable lock-free schema change

  1. Log in to DMS 5.0.

  2. In the navigation pane on the left, click the xinzeng icon.

    Note

    If you are using the console in simple mode, click Database Instances in the navigation pane on the left, and then click the xinzeng icon.

  3. In the Add Instance dialog box, configure the following parameters:

    1. On the Alibaba Cloud tab, select MySQL.

    2. Configure the parameters in the Basic Information and Advanced Information sections. For more information, see Register a cloud database instance.

      Category

      Parameter

      Description

      Data Source

      -

      By default, Alibaba Cloud-MySQL is selected. You can select a different database type.

      Basic Information

      Database Type

      Select the type of your database instance.

      Note

      After you select a database type, DMS automatically refreshes the parameters in the Basic Information section.

      Instance Region

      Select the region where your database instance is located.

      Other primary accounts

      This parameter appears if you select Cross-Alibaba Cloud account instances. Select the Alibaba Cloud account to which the database instance belongs.

      Note

      If the Alibaba Cloud account is not in the list, you can click Add User to add the Alibaba Cloud account of the instance owner. For more information, see Add a user.

      Registration method

      Select how to register the instance. You can use the Instance ID or the Connection String Address.

      Instance ID or Connection String Address

      Enter the Instance ID or Connection String Address.

      Note

      A connection string address consists of an internal endpoint and a port number. For example: rm-XXXXXXX.mysql.rds.aliyuncs.com:3306.

      Access mode

      Select the logon method and whether to enable security hosting for the instance. Security hosting allows you to manage permissions at a fine-grained level without exposing database credentials.

      • Security Hosting - Automatic (Recommended): DMS automatically enables security hosting and creates a database account for you to log on to the instance through DMS.

        Note
        • This parameter is available only when you register an RDS instance.

        • You can view the account that is automatically created by DMS in the RDS console. Do not modify or delete this account, as doing so can disrupt DMS features.

        • Except for ApsaraDB RDS for PostgreSQL instances, accounts that are automatically created by DMS in other RDS instances do not have the permissions to create databases or database accounts.

      • Security Hosting - Manual: DMS enables security hosting, but you must manually provide the credentials of an existing database account.

      • Security Hosting - KMS: DMS enables security hosting, but you must select an RDS credential created in KMS to log on to the database.

        Note

        This parameter is available only when you register an RDS instance.

      • Disable Security Hosting (Not Recommended): If security hosting is disabled, you must frequently use your database account and password to log on, which may interfere with normal functionality.

      Advanced feature pack

      Select a feature pack based on your needs.

      • Security Collaboration or Stable Change (select one): Security Collaboration includes all capabilities of Stable Change and adds DevOps features for flexible R&D and approval workflow customization. Stable Change provides solutions for enhanced database stability, such as lock-free schema changes and SQL reviews.

        Note

        If you select neither the Security Collaboration nor Stable Change pack, the instance uses the Flexible Management mode by default.

      • Sensitive Data Protection: This feature enables you to control and mask sensitive data. Enable this feature based on your business requirements. For more information, see Enable Sensitive Data Protection.

      Security rule

      This parameter appears if you select the Security Collaboration pack.

      You can select default or custom security rules for fine-grained control over the database.

      Classification and grading template

      The settings for the classification and grading template are displayed only when Sensitive Data Protection is enabled.

      By binding a classification and grading template to the instance, you can identify fields in database tables that match the template's rules. Matching fields are automatically tagged with classification and sensitivity levels to protect highly sensitive fields.

      Advanced Information

      Environment Type

      Select the type of the database environment.

      Instance Name

      Clear the Automatically Synchronize Instance Name checkbox to set a custom display name for the instance in DMS.

      Note

      When you register a cloud database for the first time, DMS synchronizes the name from the source instance. This synchronization does not occur for subsequent registrations. You can update the instance name by editing the instance.

      Lock-free Schema Change

      Select whether to enable the lock-free schema change feature.

      Note

      This parameter appears only for MySQL databases.

      Enable SSL

      Note

      This parameter appears only for MySQL or Redis databases.

      By default, SSL connections are disabled in DMS.

      If you need to connect to the database using SSL, you can manually enable it here. Ensure that SSL is also enabled on your database.

      Secure Sockets Layer (SSL) encrypts data at the transport layer to enhance security and integrity, but it may increase connection latency.

      Instance DBA

      Select a DBA to handle subsequent processes such as permission requests.

      Query Timeout (s)

      Set a security policy to terminate a query in the SQL console if it exceeds the specified time limit. This protects the database from long-running queries.

      Export Timeout (s)

      Set a security policy to terminate an export task in the SQL console if it exceeds the specified time limit. This protects the database from long-running exports.

  4. After you configure the parameters, click Test Connection in the lower-left corner of the Basic Information section and wait for the test to succeed.

    Note

    If the connection test fails, check and modify your settings based on the error message.

  5. After the connection test succeeds, click Submit.

Lock-free schema change

  1. Log in to DMS 5.0.

  2. In the top navigation bar, choose Database Development > Data Change > Lock-free Change.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the console and choose All Features > Database Development > Data Change > Lockless Change.

  3. Configure the lock-free change ticket. The following table describes key parameters. For more information about other parameters, see Lock-free DML change.

    Parameter

    Description

    Database

    Search for and select one or more destination databases.

    • Have Permission: Shows only databases for which you have change permissions.

    • All: Shows all databases except for those with metadata access control enabled.

      Note

      If you do not have change permissions on the target database, choose Security and Specifications > Permission Center > Permission Tickets in the top navigation bar. Then, click Apply for Permission > Database Permissions to apply for the required permissions.

    SQL statements for change

    Enter Data Definition Language (DDL) statements, such as ALTER TABLE or OPTIMIZE.

    Note

    If you enter Data Manipulation Language (DML) statements, it initiates a lock-free data change task. For more information, see Lock-free DML change.

  4. Click Submit Application.

    The system automatically performs an SQL precheck. If the precheck fails, you can click Modify SQL to revise the SQL statements based on the error and then resubmit.

  5. After the ticket is approved, click Execute Change in the Execute section of the ticket details page.

  6. Configure the task execution parameters.

    Parameter

    Description

    Execution strategy

    • Execute Immediately: This is the default option. The task starts immediately after you click Confirm Execution.

    • Schedule: Select a start time for the task. The task will run at the specified time after you click Confirm Execution.

    Specify end time

    • On: Select an end time for the task. If the task is not completed by the specified end time, the system stops the task. This prevents tasks from running during peak hours and affecting business operations.

    • Off: This is the default option.

  7. Click Confirm Execution.

    Note

    A paused task restarts from the beginning.

    • In the Execute section, you can view the task status, task settings, scheduling logs, and other information.

    • You can also view the progress of the lock-free schema change task by choosing O&M > Task Management. For more information, see View the progress of a lock-free change task.

Related operations

  • Track the progress of change tasks in the Task Management feature of DMS. For more information, see Task Management.

  • If the lock-free schema change feature is enabled, you can also perform Standard Data Change tasks without locking tables. For more information, see Standard Data Change.