All Products
Search
Document Center

Database Autonomy Service:GetDeadLockDetailList

Last Updated:Mar 13, 2026

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

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: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: no.

  • 1: yes.

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:

  • 0: no.

  • 1: yes.

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

  • false

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.