Slow Log Details
Operation description
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
polardb:DescribeSlowLogRecords | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | Region ID. Note
You can call the DescribeRegions interface to view the available regions under the target account, including the Region ID.
| cn-hangzhou |
DBClusterId | string | Yes | Cluster ID. Note
You can call the DescribeDBClusters interface to view all cluster information in the target region, including the Cluster ID.
| pc-************ |
NodeId | string | No | Node ID | pi-********** |
StartTime | string | Yes | Start time of the query. The format is Note
| 2022-11-15T16:00Z |
EndTime | string | Yes | End time of the query, which must be later than the start time, and the time interval between the start and end times must not exceed 24 hours. The format is Note
The input is UTC time (i.e., 0 timezone). If your service is currently in a different timezone, please perform a time conversion. For example, if the current timezone of your service is Beijing Time (UTC+8) at 12:00, and you need to query the slow logs between 08:00-12:00 Beijing Time, you should input 00:00-04:00.
| 2022-11-16T04:00Z |
DBName | string | No | Database name. | testdb |
PageSize | integer | No | Number of records per page, with the following options:
The default value is 30. | 30 |
PageNumber | integer | No | Page number, with a range greater than 0 and not exceeding the maximum value of Integer. The default value is 1. | 1 |
SQLHASH | string | No | Unique identifier of the SQL statement in the slow log statistics, which can be used to obtain the detailed slow logs for that SQL statement. | U2FsdGVk**** |
description
Response parameters
description
Examples
Sample success responses
JSON
format
{
"DBClusterId": "pc-*****************",
"Engine": "polardb_mysql",
"Items": {
"SQLSlowRecord": [
{
"DBName": "testdb",
"DBNodeId": "pi-*****************",
"ExecutionStartTime": "2021-04-07T03:47Z",
"HostAddress": "testdb[testdb] @ [100.**.**.242]",
"LockTimes": 0,
"ParseRowCounts": 0,
"QueryTimeMS": 100,
"QueryTimes": 20,
"ReturnRowCounts": 0,
"SQLHash": "U2FsdGVk****",
"SQLText": "/* Query from *** by user 111 */ SELECT sleep(20)"
}
]
},
"PageNumber": 1,
"PageRecordCount": 1,
"RequestId": "A7E6A8FD-C50B-46B2-BA85-D8B8D3******",
"TotalRecordCount": 1
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidStartTime.Malformed | The specified parameter StartTime is not valid. | The specified StartTime parameter is invalid. |
404 | InvalidDBClusterId.NotFound | The DBInstanceId provided does not exist in our records. | The specified DBClusterId parameter does not exist in the current record. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-06-19 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-06-12 | The Error code has changed | View Change Details |