全部產品
Search
文件中心

Database Autonomy Service:GetDeadLockDetail - 查詢單個死結詳情

更新時間:Apr 21, 2026

查詢單個死結詳情。

介面說明

本介面用於擷取最近死結分析、全量死結分析的單個死結詳情。詳情請參見死結分析

使用該介面需滿足以下前提條件:

  • 查詢最近死結分析詳情的目標資料庫引擎為:RDS MySQL、自建 MySQL、PolarDB MySQL 版、PolarDB-X 2.0。

  • 查詢全量死結分析詳情的目標資料庫引擎為:RDS MySQL、PolarDB MySQL 版,且已開通DAS 營運服務(原經濟版)

  • 使用阿里雲或 DAS 的 SDK 時,建議使用最新版本。

  • 使用 SDK 調用 DAS 服務時,需要將地區指定為 cn-shanghai。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

hdm:GetDeadLockDetail

none

*全部資源

*

請求參數

名稱

類型

必填

描述

樣本值

InstanceId

string

執行個體 ID。

pc-bp1u5mas9exx7****

NodeId

string

節點 ID。

說明

對於 PolarDB MySQL 版執行個體,需要提供節點 ID。

pi-bp16v3824rt73****

TextId

string

查詢死結歷史工作清單 GetDeadLockHistory 中返回的死結 TextId。

a0e390cd5aca9ae964448f040153****

Source

string

任務來源:

  • MANUAL不傳入:查詢最近死結分析任務。

  • AUTO:查詢全量死結分析任務。

AUTO

返回參數

名稱

類型

描述

樣本值

object

RequestId

string

請求 ID。

9CB97BC4-6479-55D0-B9D0-EA925AFE****

Message

string

請求返回訊息。

說明

請求成功時該參數返回 Successful,請求失敗時會返回請求異常資訊(如錯誤碼等)。

Successful

Synchro

string

備用參數。

None

Data

string

返回的 JSON 格式資料:

  • accountId:使用者識別碼。

  • textId:死結文本 ID。

  • gmtModified:診斷產生時間。

  • originText:LATEST DETECTED DEADLOCK 的原始死結文本或錯誤記錄檔中的原始死結文本。

  • deadlock:死結詳情:
    • occurTime:死結發生時間。

    • originTextId:死結文本 ID。

    • rollbackTrxId:復原的事務編號。

    • transactions:
      • deadlockIdInDB:DB 中的死結編號。

      • ip:訪問 IP。

      • queryId:請求 ID。

      • queryType:請求類型。

      • relatedTables:相關表。

      • tableNamesString:相關表。

      • sqlText:SQL 文本。

      • threadId:線程 ID。

      • transactionId:事務 ID。

      • trxIdInLock:死結中的事務編號。

      • userName:資料庫使用者名稱。

      • waitLockIndexName:等待鎖索引名。

      • waitLockMode:等待鎖類型。

      • lockWait:等待鎖。

      • holdLockIndexName:持有鎖索引名。

      • holdLockMode:持有鎖類型。

      • lockHold:持有鎖。

    • trxNum:事務數量。

  • gmtCreate:診斷建立時間。

  • nodeId:節點 ID。

  • uuid:執行個體 ID。

{ "accountId": "108************", "textId": "35303d12d52d29ba73bb************", "gmtModified": 1732712680000, "originText": "LATEST DETECTED DEADLOCK****", "deadlock": "{\"id\":0,\"occurTime\":1732687047000,\"originTextId\":\"35303d12d52d29ba73bb************\",\"rollbackTrxId\":\"2\",\"transactions\":[{\"deadlockIdInDB\":0,\"ip\":\"100.***.***.***\",\"lockWait\":\"index PRIMARY of table `das`.`students` trx id 15989454 lock_mode X locks rec but not gap waiting\",\"queryId\":\"386737457\",\"queryType\":\"updating\",\"relatedTables\":[\"`das`.`students`\"],\"sqlText\":\"update students set name=UUID() where id = 2 \",\"tableNamesString\":\"`das`.`students`\",\"threadId\":\"9194526\",\"transactionId\":\"15989454\",\"trxIdInLock\":1,\"userName\":\"das\",\"waitLockIndexName\":\"PRIMARY \",\"waitLockMode\":\"X locks rec but not gap waiting\"},{\"deadlockIdInDB\":0,\"holdLockIndexName\":\"PRIMARY \",\"holdLockMode\":\"X locks rec but not gap\",\"ip\":\"100.***.***.***\",\"lockHold\":\"index PRIMARY of table `das`.`students` trx id 15989451 lock_mode X locks rec but not gap\",\"lockWait\":\"index PRIMARY of table `das`.`students` trx id 15989451 lock_mode X locks rec but not gap waiting\",\"queryId\":\"386737566\",\"queryType\":\"updating\",\"relatedTables\":[\"`das`.`students`\"],\"sqlText\":\"update students set name=UUID() where id = 3 \",\"tableNamesString\":\"`das`.`students`\",\"threadId\":\"9194501\",\"transactionId\":\"15989451\",\"trxIdInLock\":2,\"userName\":\"das\",\"waitLockIndexName\":\"PRIMARY \",\"waitLockMode\":\"X locks rec but not gap waiting\"}],\"trxNum\":2}", "gmtCreate": 1732712680000, "nodeId": "pi-8****************", "uuid": "pc-8v***************" }

Code

string

返回的狀態代碼。

200

Success

string

請求是否執行成功:

  • true:執行成功。

  • false:執行失敗。

true

樣本

正常返回樣本

JSON格式

{
  "RequestId": "9CB97BC4-6479-55D0-B9D0-EA925AFE****",
  "Message": "Successful",
  "Synchro": "None",
  "Data": "{\n    \"accountId\": \"108************\",\n    \"textId\": \"35303d12d52d29ba73bb************\",\n    \"gmtModified\": 1732712680000,\n    \"originText\": \"LATEST DETECTED DEADLOCK****\",\n    \"deadlock\": \"{\\\"id\\\":0,\\\"occurTime\\\":1732687047000,\\\"originTextId\\\":\\\"35303d12d52d29ba73bb************\\\",\\\"rollbackTrxId\\\":\\\"2\\\",\\\"transactions\\\":[{\\\"deadlockIdInDB\\\":0,\\\"ip\\\":\\\"100.***.***.***\\\",\\\"lockWait\\\":\\\"index PRIMARY of table `das`.`students` trx id 15989454 lock_mode X locks rec but not gap waiting\\\",\\\"queryId\\\":\\\"386737457\\\",\\\"queryType\\\":\\\"updating\\\",\\\"relatedTables\\\":[\\\"`das`.`students`\\\"],\\\"sqlText\\\":\\\"update students set name=UUID() where id = 2 \\\",\\\"tableNamesString\\\":\\\"`das`.`students`\\\",\\\"threadId\\\":\\\"9194526\\\",\\\"transactionId\\\":\\\"15989454\\\",\\\"trxIdInLock\\\":1,\\\"userName\\\":\\\"das\\\",\\\"waitLockIndexName\\\":\\\"PRIMARY \\\",\\\"waitLockMode\\\":\\\"X locks rec but not gap waiting\\\"},{\\\"deadlockIdInDB\\\":0,\\\"holdLockIndexName\\\":\\\"PRIMARY \\\",\\\"holdLockMode\\\":\\\"X locks rec but not gap\\\",\\\"ip\\\":\\\"100.***.***.***\\\",\\\"lockHold\\\":\\\"index PRIMARY of table `das`.`students` trx id 15989451 lock_mode X locks rec but not gap\\\",\\\"lockWait\\\":\\\"index PRIMARY of table `das`.`students` trx id 15989451 lock_mode X locks rec but not gap waiting\\\",\\\"queryId\\\":\\\"386737566\\\",\\\"queryType\\\":\\\"updating\\\",\\\"relatedTables\\\":[\\\"`das`.`students`\\\"],\\\"sqlText\\\":\\\"update students set name=UUID() where id = 3 \\\",\\\"tableNamesString\\\":\\\"`das`.`students`\\\",\\\"threadId\\\":\\\"9194501\\\",\\\"transactionId\\\":\\\"15989451\\\",\\\"trxIdInLock\\\":2,\\\"userName\\\":\\\"das\\\",\\\"waitLockIndexName\\\":\\\"PRIMARY \\\",\\\"waitLockMode\\\":\\\"X locks rec but not gap waiting\\\"}],\\\"trxNum\\\":2}\",\n    \"gmtCreate\": 1732712680000,\n    \"nodeId\": \"pi-8****************\",\n    \"uuid\": \"pc-8v***************\"\n}",
  "Code": "200",
  "Success": "true"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidParams The request parameters are invalid. 請求參數錯誤
403 NoPermission You are not authorized to do this action. 沒有許可權執行該操作

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情