You need to enable JavaScript to run this app.
Database Workshop

Database Workshop

Copy page
Download PDF
Observation and diagnosis
Transaction and lock management
Copy page
Download PDF
Transaction and lock management
The Transactions and Locks feature can capture and analyze in real time the current lock related conditions such as held locks, deadlocks, and lock waits in a RDS for MySQL instance. When lock-wait issues occur in the database, you can use the Transactions and Locks analysis feature to intuitively examine and visualize relevant locking information such as blocked sessions, holding transactions, and wait chains enabling rapid identification and resolution of the root cause. This helps ensure stable database operation and significantly reduces troubleshooting time. This article describes how to view all transaction and lock information occurring within an instance database in the DBW console.​
Prerequisites​
tip​
This feature is not supported when the instance status is creating, recovering, importing, error, deleted, terminated, waiting for payment, billing suspension in progress, billing restoring, billing reclaiming or reconstructing.​
Precautions​
The Transactions and Locks feature can capture and analyze in real time the current lock related conditions such as held locks, deadlocks, and lock waits in a RDS for MySQL instance. When lock-wait issues occur in the database, you can use the Transactions and Locks analysis feature to intuitively examine and visualize relevant locking information such as blocked sessions, holding transactions, and wait chains enabling rapid identification and resolution of the root cause. This helps ensure stable database operation and significantly reduces troubleshooting time. This article describes how to view all transaction and lock information occurring within an instance database in the DBW console.​
Prerequisites​
  • This feature is not supported when the instance status is creating, recovering, importing, error, deleted, terminated, waiting for payment, billing suspension in progress, billing restoring, billing reclaiming or reconstructing.​
Precautions​
  • While using the transaction and lock feature, avoid modifying instance configurations, as this may prevent normal display of transactions and locks.​
  • Query results can be retained for up to 30 days.​
  • Considerations for each module are as follows:​
  • ​
    InnoDB Transactions and Locks
    Deadlock information
    Lock wait message
    ​
    • For RDS for MySQL instances of version 8.0, analysis results are sourced from the following tables:​
    • information_schema.INNODB_TRX: Displays all currently running InnoDB transactions.​
    • performance_schema.data_locks: Shows all locks (InnoDB row/table locks) held by current transactions.​
    • performance_schema.data_lock_waits: Used to view current lock wait relationships (i.e., who is waiting for whom).​
    • For RDS for MySQL instances of version 5.7:​
    • When there is no lock contention between transactions, specific lock details, such as transaction IDs, cannot be detected.​
    • Analysis results are sourced from the following tables:​
    • information_schema.INNODB_TRX: Displays all currently running InnoDB transactions.​
    • information_schema.INNODB_LOCKS: Used to view all locks (InnoDB row/table locks) currently held by transactions.​
    • information_schema.INNODB_LOCK_WAITS: Displays current lock wait relationships (i.e., who is waiting for whom).​
    ​
Procedure​
  1. Log on to the DBW console.​
  1. On the top menu bar, select the project and region.​
  1. On the left navigation bar, select Operation and maintenance management > Observation and diagnosis.​
  1. On the Observation and diagnosis page, click Transaction and lock.​
  1. In the upper-right corner of the page, locate the drop-down list and select the target database type - RDS for MySQL.​
  1. In the upper-right corner of the page, locate the drop-down list and select the target instance.​
  1. On the Transaction and lock tab, select the instance node as needed (the primary node is displayed by default) to view the transaction and lock information for that instance, as detailed in the table below.​
  • ​
    InnoDB transaction and lock information
    Deadlock information
    Lock wait message
    ​
    tip​
    If a lock is held but no contention occurs, the specific lock details cannot be viewed.​
    In the InnoDB transaction and lock information subtab, you can perform the following actions:​
    • Create analysis task: In the InnoDB transaction and lock information sub-tab, you can either click Create analysis to manually create a task (with Task source labeled as Trigger-based analysis), or select an automatic interval of 3 seconds, 5 seconds, 10 seconds, or 15 seconds from the dropdown to generate tasks (with Task source labeled as Auto-refresh analysis).​
    • View analysis results: In the InnoDB transaction and lock information sub-tab, filter analysis tasks by their generation time range as needed. By default, tasks from the last 3 hours are displayed, with a maximum history of 30 days.​
    • No transactions or locks detected: When no transactions or locks are found in the database for your analysis task, the Detected transactions and locks column will show No. You will only see the Analysis task creation time, Task source, and Analysis data.​
    • Transactions or locks detected: When transactions or locks are found in the database for your analysis task, the Detected transactions and locks column will show Yes. Click the ➕ icon before the analysis task creation time to view all session information, including Session ID, Transaction ID, Transaction state, Lock status, Transaction isolation level, Transaction execution time(s), Transaction start time, Transaction wait since, Executing SQL, Transaction locked tables, Transaction locked rows, Number of rows modified by the transaction, ID of the blocking transaction, and NodeId.​
    • When transactions or locks exist, click the target session ID to navigate to the session management tab, where you can terminate the corresponding session as needed. For detailed steps, see Terminate session.​
    • When transactions or locks exist, you can copy the SQL statement executed by the corresponding session from the Executing SQL column.​
    ​
  • ​
Last updated: 2026.07.02 16:56:33