All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeAnomalySQLList

Last Updated:Apr 29, 2024

You can call this operation to obtain the list of SQL statements that may have performance problems according to the diagnostic system.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
TenantIdstringYes

The ID of the tenant.

t2mr3oae0****
StartTimestringYes

The start time of the time range for querying suspicious SQL statements.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

2021-06-13T15:40:43Z
EndTimestringYes

The end time of the time range for querying suspicious SQL statements.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

2021-09-13T15:40:43Z
DbNamestringNo

The name of the database.

testdb
SearchKeyWordstringNo

The search keyword.

update
SearchParameterstringNo

The search parameter.

cputime
SearchRulestringNo

The search rule.
Valid values: "=", ">", ">=", "<", and "<="

>
SearchValuestringNo

The search value.

0.01
SQLIdstringNo

SQLID.

8D6E84****0B8FB1823D199E2CA1****
NodeIpstringNo

The IP address of the node.

i-bp19y05uq6xpacyqnlrc
AcceptLanguagestringNo

The language of the returned data.
Default value: CN for a China site and EN for an International site.

zh-CN
PageSizeintegerNo

The number of rows to return on each page.

  • Maximum value: 100
  • Default value: 10
10
PageNumberintegerNo

The number of the page to return.

  • Start value: 1
  • Default value: 1
1
FilterConditionobjectNo

The filter condition.

Note
- All fields in OceanBase Database support filtering.
- You can write the key-value pair of a parameter in a JSON string in the JSON format to filter the parameter.
Enumeration Value:
  • UserName: UserName.
  • Event: Event.
  • SQLType: SQLType.
  • ClientIp: ClientIp.
{ "UserName":testUser }
SortColumnstringNo

The sorted column.

cputime
SortOrderstringNo

The sorting rule.

Enumeration Value:
  • { "dbname":test, "SQLType":null }: { "dbname":test, "SQLType":null }.
desc

Response parameters

ParameterTypeDescriptionExample
object

The return result of the request.

TotalCountlong

The total count.

2
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
AnomalySQLListobject []

The list of suspicious SQL statements.

Keylong

The sequence number of the returned SQL statement.

1
DiagnosisRulestring

The diagnostic rule.

Utilization above threshold
SQLTextstring

The SQL text.

SELECT **** FROM **** WHERE **** = ? AND **** = ? ORDER BY **** ASC
Suggestionstring

The suggestions.

Check your business scenarios, data distribution changes, request surges, and execution plan changes.
DbNamestring

The name of the database.

database1
RequestTimeUTCStringstring

The request time in UTC +0.

2022-01-11T07:08:00Z
CpuTimefloat

The average CPU time, in ms.

50.13
SQLIdstring

SQLID.

99E9D3BF****B486239E6C7BC79B****
Diagnosisstring

The diagnosis information.

Total number of executions = 80199, Average CPU time = 6.8 ms, Overall CPU utilization = 87%
RequestTimefloat

The request time, in ms.

50.00
Executionslong

The number of executions.

89043
UserNamestring

The username.

tester

Examples

Sample success responses

JSONformat

{
  "TotalCount": 2,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "AnomalySQLList": [
    {
      "Key": 1,
      "DiagnosisRule": "Utilization above threshold",
      "SQLText": "SELECT  ****   FROM ****   WHERE **** = ? AND **** = ?   ORDER BY **** ASC",
      "Suggestion": "Check your business scenarios, data distribution changes, request surges, and execution plan changes.",
      "DbName": "database1",
      "RequestTimeUTCString": "2022-01-11T07:08:00Z",
      "CpuTime": 50.13,
      "SQLId": "99E9D3BF****B486239E6C7BC79B****",
      "Diagnosis": "Total number of executions = 80199, Average CPU time = 6.8 ms, Overall CPU utilization = 87%",
      "RequestTime": 50,
      "Executions": 89043,
      "UserName": "tester"
    }
  ]
}

Error codes

HTTP status codeError codeError message
2014InternalErrorThe request processing has failed due to some unknown error.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-08-21The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 2014
2023-07-04The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 2014
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: InstanceId