調用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 且不超過 整數資料類型的最大值,預設值為 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. | 沒有許可權執行該操作 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。