调用GetDeadLockDetailList接口,查询RDS SQL Server实例的死锁详情列表。
接口说明
本接口仅适用于 RDS SQL Server 版实例。
使用阿里云或 DAS 的 SDK 时,建议使用最新版本。
在使用 SDK 调用 DAS 服务时,需要将地域指定为 cn-shanghai。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
hdm:GetDeadLockDetailList |
list |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
数据库实例 ID。 |
rm-2ze2016723b32**** |
| StartTime |
string |
是 |
查询开始时间,格式为 Unix 时间戳,单位为毫秒。 |
1701755730292 |
| EndTime |
string |
是 |
查询结束时间,格式为 Unix 时间戳,单位为毫秒。 |
1702360530292 |
| PageNo |
string |
否 |
页码,取值大于 0 且不超过 Integer 数据类型的最大值,默认值为 1。 |
1 |
| PageSize |
string |
否 |
每页最大记录数,默认值为 10。 |
5 |
| DbNameList |
string |
否 |
数据库名。传入多个数据库时,各个数据库名称间使用英文逗号(,)进行分隔。 |
testdb1,testdb2 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| Code |
string |
返回的状态码。 |
200 |
| Message |
string |
请求返回消息。 说明
请求成功时该参数返回 Successful,请求失败时会返回请求异常信息(如错误码等)。 |
Successful |
| Data |
object |
返回的数据。 |
|
| List |
array<object> |
详细信息列表。 |
|
|
array<object> |
返回信息列表。 |
||
| BatchId |
integer |
采集的时间,格式为 Unix 时间戳,单位为毫秒。 |
1702301170701 |
| BlockProcessList |
array<object> |
阻塞列表。即主动造成锁定的会话信息。 |
|
|
object |
|||
| ClientApp |
string |
当前事务所使用的客户端名称。 |
Microsoft SQL Server Management Studio - Query |
| HostName |
string |
主机名。 |
sd7402**** |
| LastTranStarted |
integer |
事务开启的时间。格式为 Unix 时间戳,单位为毫秒。 |
1702301152000 |
| LockMode |
string |
锁模式。更多信息,请参见锁模式。 |
U |
| LogUsed |
integer |
会话已经生成的日志大小。单位:字节(Byte)。 |
352 |
| LoginName |
string |
用户登录名。 |
sd7402****\\Administrator |
| ObjectOwned |
string |
已经被锁住的对象。 |
testdb1.dbo.test2 |
| ObjectRequested |
string |
当前事务请求加锁的对象。 |
testdb1.dbo.test1 |
| OwnMode |
string |
会话当前持有的锁模式。更多信息,请参见锁模式。 |
X |
| Spid |
integer |
开启事务的会话 ID。 |
61 |
| SqlText |
string |
SQL 语句详情。 |
update test1 set col1 =9 |
| Status |
string |
当前事务的状态。 |
suspended |
| Victim |
integer |
是否是死锁的受害者:
|
0 |
| WaitMode |
string |
会话当前正在等待的锁模式。更多信息,请参见锁模式。 |
U |
| WaitResource |
string |
当前事务等待中的资源。 |
RID: 5:1:312:0 |
| WaitResourceDescription |
string |
当前事务等待中的资源详情。 |
RID:school:school.mdf:312:0 |
| DatabaseName |
string |
数据库名称。 |
testdb1 |
| ClientApp |
string |
客户端名称。 |
Microsoft SQL Server Management Studio - Query |
| HostName |
string |
主机名。 |
sd7402**** |
| LastTranStarted |
integer |
事务开启的时间。格式为 Unix 时间戳,单位为毫秒。 |
1702301141000 |
| LockMode |
string |
锁模式。更多信息,请参见锁模式。 |
U |
| LogUsed |
integer |
会话已经生成的日志大小。单位:字节(Byte)。 |
352 |
| LoginName |
string |
用户登录名。 |
sd7402****\\Administrator |
| ObjectRequested |
string |
当前事务请求加锁的对象。 |
testdb1.dbo.test2 |
| ObjectOwned |
string |
已经被锁住的对象。 |
testdb1.dbo.test1 |
| OwnMode |
string |
会话当前持有的锁模式。更多信息,请参见锁模式。 |
X |
| Spid |
integer |
开启事务的会话 ID。 |
56 |
| SqlText |
string |
SQL 语句详情。 |
update test2 set col1 =88 |
| Status |
string |
当前事务的状态。 |
suspended |
| Victim |
integer |
是否是死锁的受害者:
|
1 |
| WaitMode |
string |
会话当前正在等待的锁模式。更多信息,请参见锁模式。 |
U |
| WaitResource |
string |
当前事务等待中的资源。 |
RID: 5:1:376:0 |
| WaitResourceDescription |
string |
当前事务等待中的资源详情。 |
RID:school:school.mdf:376:0 |
| DatabaseName |
string |
数据库的名称。 |
testdb1 |
| PageNo |
integer |
当前页码。 |
1 |
| PageSize |
integer |
每页记录数。 |
10 |
| Total |
integer |
返回总记录数。 |
2 |
| RequestId |
string |
请求 ID。 |
840F51F7-9C01-538D-94F6-AE712905**** |
| Success |
string |
请求是否执行成功:
|
true |
示例
正常返回示例
JSON格式
{
"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"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | 请求参数错误 |
| 403 | NoPermission | You are not authorized to do this action. | 没有权限执行该操作 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。