Deadlocks
Scenarios
RDS for SQL Server provides powerful deadlock detection. If there are two or more processes accessing the same resource at the same time, a deadlock may occur because the processes are waiting for each other to release the resource and cannot continue running. In this case, RDS for SQL Server kills one of the processes so that the other processes can complete their transactions.
To solve this problem, the Deadlocks page is provided. On this page, you can quickly locate various types of deadlocks in your instance. The Details area displays information such as transaction start time, session ID, locked resource details, and deadlock mode, helping you locate and optimize problematic SQL statements and other exceptions.
If Intelligent O&M is not subscribed, records of a maximum of seven days can be retained.
Procedure
- Log in to the management console.
- Click in the upper left corner and select a region.
- Click in the upper left corner of the page and choose Databases > Relational Database Service.
- On the Instances page, click the DB instance name.
- In the navigation pane, choose DBA Assistant > Historical Diagnosis.
- Click the Deadlocks tab.
- Deadlocks
You can view the number of deadlocks in the last day, last week, last two weeks, last month, or in a custom time interval.
- Deadlocks over Time
You can view deadlocks over time within a specified period.
Table 1 Parameter description Parameter
Description
Total
Total number of deadlocks.
Key Lock
Number of index-related deadlocks.
Object Lock
Number of object-related deadlocks.
Rid Lock
Number of row deadlocks.
Page Lock
Number of page deadlocks.
Compile Lock
Number of compilation deadlocks.
- Details
You can view details of deadlocks within a specified period.
To view the deadlock relationship diagram, click Deadlock Diagram in the Operation column. In the displayed dialog box, you can click Download to download the diagram.
The downloaded deadlock diagram is an XDL file. You can open and check it using the SQL Server Management Studio (SSMS) client.
Table 2 Parameter description Parameter
Description
LastTranStarted
Start time of the transaction.
SPID
ID of the session that starts the transaction.
isVictim
Whether the session is killed.
Database
Name of the database where the transaction is executed.
LogUsed
Size of logs that have been generated for the session, in bytes.
LockMode
Lock mode.
WaitResourceDesc
Details of the resource that the transaction is waiting for.
ObjectOwned
Locked object.
ObjectRequested
Object that the transaction requests to lock.
WaitResource
Resource that the transaction is waiting for.
HostName
Name of the host on which the transaction is run.
LoginName
Username of the account that is used to run the transaction.
Status
Transaction status.
ClientApp
Name of the client that initiates the transaction.
SQL
SQL statement details.
Operation
You can view the deadlock diagram.
- Details
- Deadlocks
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot