Retrieves slow log details for Simple Database Service.
Operation description
You can query the slow logs of a Simple Database Service instance to diagnose issues.
Simple Database Service retains slow logs for 7 days.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
swas-open:DescribeDatabaseSlowLogRecords |
get |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the lightweight database instance. You can call the ListRegions operation to get the latest list of supported Alibaba Cloud regions. |
cn-hangzhou |
| DatabaseInstanceId |
string |
Yes |
The ID of the lightweight database instance. |
db-38263fa955774501a2ae1bdaed6f**** |
| PageNumber |
integer |
No |
The page number. Starting value: 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Valid values: 30 to 100. Default value: 30. |
30 |
| StartTime |
string |
Yes |
The beginning of the time range to query. The time is in UTC and must be formatted as Note
The console displays this time in the UTC+8 time zone. |
2022-09-07T04:04:44Z |
| EndTime |
string |
Yes |
The end of the time range to query. The end time must be later than the start time. The interval between the start time and the end time cannot be longer than 7 days. The time is in UTC and must be formatted as Note
The console displays this time in the UTC+8 time zone. |
2022-09-08T04:04:44Z |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| RequestId |
string |
The request ID. |
30637AD6-D977-4833-A54C-CC89483E**** |
| PageNumber |
integer |
The page number of the returned page. Starts from 1. Default value: 1. |
1 |
| PageSize |
integer |
The number of entries to return on each page. Valid values: 30 to 100. Default value: 30. |
30 |
| TotalCount |
integer |
The total number of slow query logs. |
20 |
| PhysicalIORead |
integer |
The number of logical reads. |
200 |
| Engine |
string |
The database engine. |
MySQL |
| SlowLogs |
array<object> |
The slow query logs. |
|
|
object |
Details of slow query logs. |
||
| HostAddress |
string |
The IP address of the client that is used to connect to the database. |
xxx[xxx] @ [1xx.xxx.xxx.xx] |
| QueryTimes |
integer |
The execution duration. Unit: seconds. |
2 |
| SQLText |
string |
The details of the SQL statement. |
select sleep(2) |
| QueryTimeMS |
integer |
The execution duration. Unit: milliseconds. |
2001 |
| LockTimes |
integer |
The lock duration. Unit: seconds. |
0 |
| ExecutionStartTime |
string |
The start time of the execution. The time is displayed in UTC and is in the Note
The time displayed in the console is in the UTC+8 time zone, which is 8 hours later than the time in UTC. |
2022-09-08T01:40:44Z |
| ReturnRowCounts |
integer |
The number of returned rows. |
1 |
| ParseRowCounts |
integer |
The number of parsed rows. |
1 |
| DBName |
string |
The database name. |
testDB |
Examples
Success response
JSON format
{
"RequestId": "30637AD6-D977-4833-A54C-CC89483E****",
"PageNumber": 1,
"PageSize": 30,
"TotalCount": 20,
"PhysicalIORead": 200,
"Engine": "MySQL",
"SlowLogs": [
{
"HostAddress": "xxx[xxx] @ [1xx.xxx.xxx.xx]",
"QueryTimes": 2,
"SQLText": "select sleep(2)",
"QueryTimeMS": 2001,
"LockTimes": 0,
"ExecutionStartTime": "2022-09-08T01:40:44Z",
"ReturnRowCounts": 1,
"ParseRowCounts": 1,
"DBName": "testDB"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.