Updated on 2026-08-25 GMT+08:00

Querying Deadlock Details

Function

This API is used to query deadlock details.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the permission listed below is required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    das::showCloudDBAInfo

    read

    -

    -

    -

    -

URI

GET /v3/{project_id}/instances/{instance_id}/dead-lock/get-dead-lock-detail-list

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

db_name

Yes

String

Definition

Database name.

Constraints

N/A

Range

N/A

Default Value

N/A

start_time

Yes

Long

Definition

Start timestamp (ms).

Constraints

N/A

Range

N/A

Default Value

N/A

end_time

Yes

Long

Definition

End timestamp (ms).

Constraints

N/A

Range

N/A

Default Value

N/A

cur_page

Yes

Integer

Definition

Page number.

Constraints

N/A

Range

N/A

Default Value

N/A

per_page

Yes

Integer

Definition

Size of data returned per page.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

detail_list

Array of objects in Table 4

Definition

Deadlock details.

Range

N/A

total

Long

Definition

Total number.

Range

N/A

Table 4 Detail

Parameter

Type

Description

dead_lock_id

String

Definition

Deadlock ID.

Range

N/A

last_tran_started

String

Definition

Transaction start time.

Range

N/A

spid

String

Definition

Service process ID.

Range

N/A

is_victim

Boolean

Definition

Whether the session has been terminated.

Range

N/A

log_used

Long

Definition

Log space used by a task.

Range

N/A

lock_mode

String

Definition

Lock mode (S, X, or U).

Range

N/A

wait_resource_desc

String

Definition

Details of the resource being waited for.

Range

N/A

object_owned

String

Definition

Locked object.

Range

N/A

object_requested

String

Definition

Object to be locked.

Range

N/A

wait_resource

String

Definition

Name of the resource being waited for.

Range

N/A

host_name

String

Definition

Host name.

Range

N/A

login_name

String

Definition

Status.

Range

N/A

status

String

Definition

Details of the resource being waited for.

Range

N/A

client_app

String

Definition

Client.

Range

N/A

sql

String

Definition

SQL statement.

Range

N/A

db_id

String

Definition

Database ID.

Range

N/A

db_name

String

Definition

Database name.

Range

N/A

sub_detail_list

Array of objects in Table 5

Definition

Deadlock sub-details.

Range

N/A

Table 5 subDetail

Parameter

Type

Description

last_tran_started

String

Definition

Transaction start time.

Range

N/A

spid

String

Definition

Service process ID.

Range

N/A

is_victim

Boolean

Definition

Whether the session has been terminated.

Range

N/A

log_used

Long

Definition

Log space used by a task.

Range

N/A

lock_mode

String

Definition

Lock mode (S, X, or U).

Range

N/A

wait_resource_desc

String

Definition

Details of the resource being waited for.

Range

N/A

object_owned

String

Definition

Locked object.

Range

N/A

object_requested

String

Definition

Object to be locked.

Range

N/A

wait_resource

String

Definition

Name of the resource being waited for.

Range

N/A

host_name

String

Definition

Host name.

Range

N/A

login_name

String

Definition

Status.

Range

N/A

status

String

Definition

Details of the resource being waited for.

Range

N/A

client_app

String

Definition

Client.

Range

N/A

sql

String

Definition

SQL statement.

Range

N/A

db_id

String

Definition

Database ID.

Range

N/A

db_name

String

Definition

Database name.

Range

N/A

Example Requests

GET https://das.cn-north-1.myhuaweicloud.com/v3/052041494800d57c2f02c00275b4c247/instances/47d0524891964dc48cee42c371928777in04/dead-lock/get-dead-lock-detail-list?cur_page=1&per_page=10&start_time=1762830629423&end_time=1764040229423&db_name= 
 

Example Responses

Status code: 200

Success.

{
    "detail_list": [
        {
            "dead_lock_id": "40DB3062B1662DE9",
            "last_tran_started": "2025-11-25T11:42:15.827",
            "spid": "59",
            "is_victim": true,
            "log_used": 252,
            "lock_mode": "X",
            "wait_resource_desc": "KEY: test.dbo.test_deadlock2",
            "object_owned": "test.dbo.test_deadlock2",
            "object_requested": "test.dbo.test_deadlock1",
            "wait_resource": "KEY: 6:72057594045792256 (8194443284a0)",
            "host_name": "dbs_das_service2",
            "login_name": "rdsuser",
            "status": "suspended",
            "client_app": "Microsoft JDBC Driver for SQL Server",
            "sql": "BEGIN TRAN  UPDATE dbo.test_deadlock2 SET name = 'CC' WHERE id = 1 ; UPDATE dbo.test_deadlock1 SET name = 'CC' WHERE id = 1 ; COMMIT",
            "db_id": "6",
            "db_name": "test",
            "sub_detail_list": [
                {
                    "last_tran_started": "2025-11-25T11:42:14.277",
                    "spid": "58",
                    "is_victim": false,
                    "log_used": 252,
                    "lock_mode": "X",
                    "wait_resource_desc": "KEY: test.dbo.test_deadlock1",
                    "object_owned": "test.dbo.test_deadlock1",
                    "object_requested": "test.dbo.test_deadlock2",
                    "wait_resource": "KEY: 6:72057594045857792 (8194443284a0)",
                    "host_name": "dbs_das_service2",
                    "login_name": "rdsuser",
                    "status": "suspended",
                    "client_app": "Microsoft JDBC Driver for SQL Server",
                    "sql": "BEGIN TRAN  UPDATE dbo.test_deadlock1 SET name = 'CC' WHERE id = 1 ; WAITFOR DELAY '00:00:05' UPDATE dbo.test_deadlock2 SET name = 'CC' WHERE id = 1 ; ROLLBACK  ",
                    "db_id": "6",
                    "db_name": "test"
                }
            ]
        }
    ],
    "total": 1
}

Status Codes

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Codes

See Error Codes.