All Products
Search
Document Center

Database Autonomy Service:Other lock analysis

Last Updated:Sep 18, 2025

This topic describes how to use the lock analysis feature of Database Autonomy Service (DAS) to analyze metadata lock waits and transaction blocking.

Note

The data in the figures is for demonstration purposes only. In practice, parameters such as thread IDs and SQL statements will differ based on your actual database environment.

Prerequisites

Lock types

  • Metadata lock analysis

    • Analytical data: DAS determines the lock wait relationship and generates a relationship graph based on data from tables such as information_schema.processlist.

  • Transaction blocking analysis

    Important

    The transaction blocking analysis feature is not supported for PolarDB for MySQL 5.6 instances.

    • Analytical data: DAS analyzes the transaction blocking relationship and generates a relationship graph based on data from information_schema.processlist, information_schema.innodb_trx, and the following tables.

      • RDS for MySQL 5.6 and 5.7: information_schema.innodb_lock_waits

      • PolarDB for MySQL 5.7: information_schema.innodb_lock_waits

      • RDS for MySQL and PolarDB for MySQL 8.0: performance_schema.data_lock_waits

    • Parameter settings: For RDS for MySQL 8.0 and PolarDB for MySQL 8.0 instances, enable the performance_schema parameter. To modify the parameters of a database instance:

Trigger methods

Triggered analysis in Lock Analysis

Create an analysis

  1. Log on to the DAS console.

  2. In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.

  3. On the page that appears, find the database instance that you want to manage and click the instance ID. The instance details page appears.

  4. In the navigation pane on the left, click Lock Analysis. In the Other Lock Analysis section of the Lock Analysis page, click Create Analysis.

    image.png

View details

Click the image icon for a diagnostic result to view information about metadata lock waits and transaction blocking.image.png

Transaction lock details

In the transaction lock list, click View Details in the Actions column. The details of the transaction lock are displayed in the following two modes:

  • List: Displays the details of blocked transactions in a list.image

  • View: Displays the lock details in a visual transaction wait relationship graph. Click a session tile to view the details of the session at the bottom.image.png

Metadata lock details

In the metadata lock list, click View Details in the Actions column. In the view, you can click a session tile to view the session details at the bottom. You can also kill related sessions.image

Combined analysis with SQL Explorer and Audit

If a suspicious session is in the Sleep state and no SQL information is available, the session may have an open transaction for which the SQL statements were executed, but the transaction was not committed or rolled back. In this case, in the navigation pane on the left of the destination instance, click SQL Explorer and Audit. On the Audit page, click Enable Advanced Query and enter the thread ID of the suspicious session to query and analyze the SQL statements that were executed. This helps you determine if a lock wait is occurring because the transaction was not committed.image.png

Automated analysis in Instance Sessions

Procedure

  1. Log on to the DAS console.

  2. In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.

  3. On the page that appears, find the database instance that you want to manage and click the instance ID. The instance details page appears.

  4. In the navigation pane on the left, click Instance Sessions. On the Session Manager page, other lock analysis is automatically triggered, and the analysis results are displayed in the upper-right corner of the page.image.png

View details on the Instance Sessions page

On the Instance Sessions page, if a lock wait exists, click View Details. In the panel that appears, you can view transaction locks (if any) and metadata locks (if any).image

Transaction lock details

In the transaction lock list, click View Details in the Actions column. You can view the transaction lock details in List or View mode. These modes are the same as those used for triggered analysis. For more information, see Transaction lock details in triggered analysis.

image.png

Metadata lock details

In the metadata lock list, click View Details in the Actions column. You can view the metadata lock details in a view. This view is the same as the one used for triggered analysis. For more information, see Metadata lock details in triggered analysis.

image.png

View details on the Lock Analysis page

On the Lock Analysis page, click the image icon for a diagnostic result to view the historical statistics of other lock analyses that were automatically triggered on the Instance Sessions page. The viewing method is the same as that for triggered analysis. For more information, see View details in triggered analysis.image.png

References