Querying the Relationship Between Blocked Sessions
Function
This API is used to query the relationship between blocked sessions.
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}/lock-blocking/get-lock-blocking-relationship
| 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
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| unique_id | Yes | String | Definition Batch ID. Constraints N/A Range N/A Default Value N/A |
| spid | Yes | String | Definition Session ID. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| detail_list | Array of objects in Table 4 | Definition Blocked session details. Range N/A |
| total | Long | Definition Total number. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition ID. Range N/A |
| unique_id | String | Definition Batch ID. Range N/A |
| spid | Long | Definition Session ID. Range N/A |
| blocked_by_spid | Long | Definition Blocked session ID. Range N/A |
| collect_time | Long | Definition Collection time. Range N/A |
| start_time | Long | Definition Start time of SQL statement execution. Range N/A |
| elapsed_time | Long | Definition Execution duration (ms). Range N/A |
| cpu | Long | Definition CPU time (ms). Range N/A |
| wait_time | Long | Definition Blocking duration (ms). Range N/A |
| wait_type | String | Definition Wait type. Range N/A |
| sql | String | Definition SQL statement. Range N/A |
| query_hash | String | Definition Query hash. Range N/A |
| db_name | String | Definition Database name. Range N/A |
| host_name | String | Definition Client host name. Range N/A |
| client_app_name | String | Definition Client name. Range N/A |
| login_id | String | Definition Current user. Range N/A |
| cmd | String | Definition SQL command type. Range N/A |
| physical_io | String | Definition I/O consumed by SQL statements. Range N/A |
Example Requests
GET https://das.cn-north-1.myhuaweicloud.com/v3/054e292c9880d4992f02c0196d3ea468/instances/298ad59e995d48b185188c41d5b40268in04/lock-blocking/get-lock-blocking-relationship?spid=579&unique_id=9F1A07BB6B9D4E2D93F6030D65718912
Example Responses
Status code: 200
Success.
{
"detail_list": [
{
"id": "1178209792_16",
"unique_id": "9F1A07BB6B9D4E2D93F6030D65718912",
"spid": 88,
"blocked_by_spid": 579,
"collect_time": 1764212163180,
"start_time": 1764212085603,
"elapsed_time": 77577,
"cpu": 168,
"wait_time": 77431,
"wait_type": "LCK_M_S",
"sql": "IF EXISTS(SELECT 1 FROM dbo.Wlt_Wms_SourceBillIndex WHERE GraspBillID=@OldBillID AND SourceBillType='SaleOrder')",
"query_hash": "653463136AAFFB23",
"db_name": "CMCSYUN533381",
"host_name": "ECS-7E43",
"client_app_name": "Data Admin Service (DAS)",
"login_id": "root",
"cmd": "CONDITIONAL",
"physical_io": 0
}
],
"total": 1
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Success. |
| 400 | Client error. |
| 500 | Server error. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot