Queries the deadlock details of an ApsaraDB RDS for SQL Server instance.
Operation description
This operation is applicable only to ApsaraDB RDS for SQL Server instances.
If you use an Alibaba Cloud SDK or Database Autonomy Service (DAS) SDK to call this operation, we recommend that you use the latest version of the SDK.
If you use an SDK to call the API operations of DAS, you must set the region ID to cn-shanghai.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetDeadLockDetailList |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the database instance. |
rm-2ze2016723b32**** |
| StartTime |
string |
Yes |
The beginning of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1701755730292 |
| EndTime |
string |
Yes |
The end of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1702360530292 |
| PageNo |
string |
No |
The page number. The value must be an integer that is greater than 0. Default value: 1. |
1 |
| PageSize |
string |
No |
The number of entries per page. Default value: 10. |
5 |
| DbNameList |
string |
No |
The name of the database. When you specify multiple databases, you must separate the database names with commas (,). |
testdb1,testdb2 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The HTTP status code returned. |
200 |
| Message |
string |
The returned message. Note
If the request is successful, Successful is returned. Otherwise, an error message such as an error code is returned. |
Successful |
| Data |
object |
The data returned. |
|
| List |
array<object> |
The details of the data returned. |
|
|
array<object> |
The details of the data returned. |
||
| BatchId |
integer |
The time when the data was collected. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1702301170701 |
| BlockProcessList |
array<object> |
The blocking details of the instance. The details are information about the session that caused the lock. |
|
|
object |
|||
| ClientApp |
string |
The name of the client that initiates the transaction in the session. |
Microsoft SQL Server Management Studio - Query |
| HostName |
string |
The hostname. |
sd7402**** |
| LastTranStarted |
integer |
The time when the transaction was started. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1702301152000 |
| LockMode |
string |
The mode of the lock. For more information, see Lock modes. |
U |
| LogUsed |
integer |
The size of the logs generated in the session. Unit: bytes. |
352 |
| LoginName |
string |
The logon name of the user. |
sd7402****\\Administrator |
| ObjectOwned |
string |
The locked object. |
testdb1.dbo.test2 |
| ObjectRequested |
string |
The object that the transaction requested to lock. |
testdb1.dbo.test1 |
| OwnMode |
string |
The lock mode held by the session. For more information, see Lock modes. |
X |
| Spid |
integer |
The ID of the session in which the transaction is started. |
61 |
| SqlText |
string |
The SQL statement. |
update test1 set col1 =9 |
| Status |
string |
The status of the transaction. |
suspended |
| Victim |
integer |
Indicates whether the session is the victim of the deadlock. Valid values:
|
0 |
| WaitMode |
string |
The lock mode requested by the session. For more information, see Lock modes. |
U |
| WaitResource |
string |
The resources requested by the transaction. |
RID: 5:1:312:0 |
| WaitResourceDescription |
string |
The details of the resources requested by the transaction. |
RID:school:school.mdf:312:0 |
| DatabaseName |
string |
The name of the database. |
testdb1 |
| ClientApp |
string |
The name of the client. |
Microsoft SQL Server Management Studio - Query |
| HostName |
string |
The hostname. |
sd7402**** |
| LastTranStarted |
integer |
The time when the transaction was started. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1702301141000 |
| LockMode |
string |
The mode of the lock. For more information, see Lock modes. |
U |
| LogUsed |
integer |
The size of the logs generated in the session. Unit: bytes. |
352 |
| LoginName |
string |
The logon name of the user. |
sd7402****\\Administrator |
| ObjectRequested |
string |
The object that the transaction requested to lock. |
testdb1.dbo.test2 |
| ObjectOwned |
string |
The locked object. |
testdb1.dbo.test1 |
| OwnMode |
string |
The lock mode held by the session. For more information, see Lock modes. |
X |
| Spid |
integer |
The ID of the session in which the transaction is started. |
56 |
| SqlText |
string |
The SQL statement. |
update test2 set col1 =88 |
| Status |
string |
The status of the transaction. |
suspended |
| Victim |
integer |
Indicates whether the session is the victim of the deadlock. Valid values:
|
1 |
| WaitMode |
string |
The lock mode requested by the session. For more information, see Lock modes. |
U |
| WaitResource |
string |
The resources requested by the transaction. |
RID: 5:1:376:0 |
| WaitResourceDescription |
string |
The details of the resources requested by the transaction. |
RID:school:school.mdf:376:0 |
| DatabaseName |
string |
The name of the database. |
testdb1 |
| PageNo |
integer |
The page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
10 |
| Total |
integer |
The total number of entries returned. |
2 |
| RequestId |
string |
The request ID. |
840F51F7-9C01-538D-94F6-AE712905**** |
| Success |
string |
Indicates whether the request is successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "Successful",
"Data": {
"List": [
{
"BatchId": 1702301170701,
"BlockProcessList": [
{
"ClientApp": "Microsoft SQL Server Management Studio - Query",
"HostName": "sd7402****",
"LastTranStarted": 1702301152000,
"LockMode": "U",
"LogUsed": 352,
"LoginName": "sd7402****\\\\Administrator",
"ObjectOwned": "testdb1.dbo.test2",
"ObjectRequested": "testdb1.dbo.test1",
"OwnMode": "X",
"Spid": 61,
"SqlText": "update test1 set col1 =9",
"Status": "suspended",
"Victim": 0,
"WaitMode": "U",
"WaitResource": "RID: 5:1:312:0",
"WaitResourceDescription": "RID:school:school.mdf:312:0",
"DatabaseName": "testdb1"
}
],
"ClientApp": "Microsoft SQL Server Management Studio - Query",
"HostName": "sd7402****",
"LastTranStarted": 1702301141000,
"LockMode": "U",
"LogUsed": 352,
"LoginName": "sd7402****\\\\Administrator",
"ObjectRequested": "testdb1.dbo.test2",
"ObjectOwned": "testdb1.dbo.test1",
"OwnMode": "X",
"Spid": 56,
"SqlText": "update test2 set col1 =88",
"Status": "suspended",
"Victim": 1,
"WaitMode": "U",
"WaitResource": "RID: 5:1:376:0",
"WaitResourceDescription": "RID:school:school.mdf:376:0",
"DatabaseName": "testdb1"
}
],
"PageNo": 1,
"PageSize": 10,
"Total": 2
},
"RequestId": "840F51F7-9C01-538D-94F6-AE712905****",
"Success": "true"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.