All Products
Search
Document Center

Database Autonomy Service:GetDeadLockHistory

Last Updated:Nov 17, 2025

Retrieves the historical analysis tasks for recent and full deadlock analysis.

Operation description

Retrieves the historical analysis records for recent and full deadlock analysis. For more information, see Deadlock analysis.

The following requirements must be met before you call this operation:

  • To query historical analysis records of recent deadlocks, the destination database engine must be RDS MySQL, self-managed MySQL, PolarDB for MySQL, or PolarDB-X 2.0.

  • To query historical analysis records of full deadlocks, the destination database engine must be RDS MySQL or PolarDB for MySQL, and DAS Alibaba Cloud Managed Services (formerly known as Economy Edition) must be enabled.

  • Use the latest version of the Alibaba Cloud SDK or DAS SDK.

  • When you use an SDK to call the DAS service, set the region to cn-shanghai.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hdm:GetDeadLockHistory

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

pc-bp1u5mas9exx7****

NodeId

string

No

The node ID.

Note

Specify the node ID for a PolarDB for MySQL instance.

pi-bp16v3824rt73****

PageNo

integer

No

The page number.

1

PageSize

integer

No

The number of entries per page. The maximum value is 100.

10

StartTime

integer

Yes

The start time of the query. This value is a UNIX timestamp. Unit: milliseconds.

Important This parameter is a Long value. To prevent precision loss during serialization and deserialization, make sure that the value does not exceed 9007199254740991.

1731983066000

EndTime

integer

Yes

The end time of the query. This value is a UNIX timestamp. Unit: milliseconds.

Important This parameter is a Long value. To prevent precision loss during serialization and deserialization, make sure that the value does not exceed 9007199254740991.

1732069466000

Source

string

No

The source of the task:

  • MANUAL or unspecified: queries tasks for recent deadlock analysis.

  • AUTO: queries tasks for full deadlock analysis.

Important If you set this parameter to AUTO to query tasks for full deadlock analysis, the start time can be a maximum of seven days earlier than the end time.

AUTO

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

B6D17591-B48B-4D31-9CD6-9B9796B2****

Message

string

The returned message.

Note

If the request is successful, Successful is returned. If the request fails, an error message such as an error code is returned.

Successful

Synchro

string

A reserved parameter.

None

Data

string

The data returned as a JSON string.

  • total: The total number of deadlocks.

  • list: The list of deadlocks.
    • accountId: The user ID.

    • textId: The text ID of the deadlock.

    • gmtModified: The time when the diagnostics were generated.

    • lockTime: The time when the deadlock occurred.

    • gmtCreate: The time when the diagnostics were created.

    • nodeId: The node ID.

    • uuid: The instance ID.

{ "total": 2, "list": [ { "accountId": "108************", "textId": "35303d12d52d29ba73bb85fa2d5b****", "gmtModified": 1732712680000, "lockTime": 1732687047000, "gmtCreate": 1732712680000, "nodeId": "pi-8****************", "uuid": "pc-8v**************" }, { "accountId": "108************", "textId": "50a24bdcc5fe7e03f92a55ae7574****", "gmtModified": 1732626448000, "lockTime": 1722500305000, "gmtCreate": 1732626448000, "nodeId": "pi-8****************", "uuid": "pc-8v**************" } ] }

Code

string

The returned status code.

200

Success

string

Indicates whether the request was successful:

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Message": "Successful",
  "Synchro": "None",
  "Data": "{\n    \"total\": 2,\n    \"list\": [\n        {\n            \"accountId\": \"108************\",\n            \"textId\": \"35303d12d52d29ba73bb85fa2d5b****\",\n            \"gmtModified\": 1732712680000,\n            \"lockTime\": 1732687047000,\n            \"gmtCreate\": 1732712680000,\n            \"nodeId\": \"pi-8****************\",\n            \"uuid\": \"pc-8v**************\"\n        },\n        {\n            \"accountId\": \"108************\",\n            \"textId\": \"50a24bdcc5fe7e03f92a55ae7574****\",\n            \"gmtModified\": 1732626448000,\n            \"lockTime\": 1722500305000,\n            \"gmtCreate\": 1732626448000,\n            \"nodeId\": \"pi-8****************\",\n            \"uuid\": \"pc-8v**************\"\n        }\n    ]\n}",
  "Code": "200",
  "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.