All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeOasAnomalySQLList

Last Updated:Apr 29, 2024

You can call this API to view the list of SQL statements that are identified as having performance issues by 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
InstanceIdstringYes

The ID of the OceanBase cluster.

ob317v4uif****
TenantIdstringYes

The ID of the tenant.

t4louaeei****
StartTimestringYes

The start time of the monitoring data.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

2023-04-12T04:38:38Z
EndTimestringYes

The end time of the monitoring data.
The value must be UTC time in the format of YYYY-MM-DDThh:mm:ssZ.

2023-04-12T05:38:38Z
DbNamestringNo

The name of the database.

db_****
SearchKeyWordstringNo

The search keyword.

update
SearchParamstringNo

The search parameter.

cputime
SearchRulestringNo

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

>
SearchValuestringNo

The search value.

0.01
SqlIdstringNo

SQL ID.

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

The node IP.

i-bp19y05uq6x*********
FilterConditionstringNo

All parameters are referenced by the symbol @. For a list of available parameters, refer to the returned parameters in Query performance indicators of an SQL statement.

@avgCpuTime > 20 and @executions > 100
AcceptLanguagestringNo

The language of the response. Valid values:

  • zh: Chinese
  • en: English
zh-CN
SqlTextLengthlongNo

Max length of the returned SQL text.

65535
CurrentlongNo

The current page.

1
PageSizelongNo

Page size.

  • Start value: 1
  • Default value: 1
10

Response parameters

ParameterTypeDescriptionExample
object

Returned response.

Dataobject []

The list of suspicious SQLs.

AvgCpuTimedouble

Average CPU time of the suspicious SQL.

100.24
AvgElapsedTimedouble

Average response time of the suspicious SQL.

100.28
AvgGetPlanTimedouble

Average time to obtain the execution plan of the suspicious SQL.

0
CpuTimedouble

CPU time of the suspicious SQL.

100.23
DbNamestring

The name of the database.

db_***
DiagTypesarray

The type of the diagnosis.

string

The type of the diagnosis.

[ "TABLE_SCAN_INDEX_NOT_USED" ]
Diagnosisstring

The details of diagnosis.

Executionsdouble

Total execution count of the suspicious SQL.

1
LastExecutedTimedouble

Last execution time of the suspicious SQL.

2023-04-12T04:38:38Z
RiskLevelstring

Risk level.

high
SqlIdstring

SQL ID.

8D6E84****0B8FB1823D199E2CA1****
SqlTextShortstring

Prefix of the SQL text.

delete /*+ XXX PARALLEL(4) */ from
Suggestionstring

Suggestion for the suspicious SQL.

review
SumElapsedTimestring

Total response time of the suspicious SQL.

11452126.36
UserNamestring

Username.

test_user
RequestIdstring

The request ID.

473469**-AA6F-4D**-B3DB-A***********
TotalCountlong

The total count.

9

Examples

Sample success responses

JSONformat

{
  "Data": [
    {
      "AvgCpuTime": 100.24,
      "AvgElapsedTime": 100.28,
      "AvgGetPlanTime": 0,
      "CpuTime": 100.23,
      "DbName": "db_***",
      "DiagTypes": [
        "[\n        \"TABLE_SCAN_INDEX_NOT_USED\"\n      ]"
      ],
      "Diagnosis": "",
      "Executions": 1,
      "LastExecutedTime": 0,
      "RiskLevel": "high",
      "SqlId": "8D6E84****0B8FB1823D199E2CA1****",
      "SqlTextShort": "delete /*+ XXX PARALLEL(4) */ from",
      "Suggestion": "review",
      "SumElapsedTime": "11452126.36",
      "UserName": "test_user"
    }
  ],
  "RequestId": "473469**-AA6F-4D**-B3DB-A***********",
  "TotalCount": 9
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-02-02The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-08-21The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: DynamicSql
    Added Input Parameters: MergeDynamicSql
Output ParametersThe response structure of the API has changed.