This API returns a list of SQL statements flagged by the diagnostic system for potential performance issues.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
oceanbase:DescribeOasAnomalySQLList |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the OceanBase instance. |
ob317v4uif**** |
| TenantId |
string |
Yes |
The tenant ID. |
t4louaeei**** |
| StartTime |
string |
Yes |
The beginning of the query period. |
2023-04-12T04:38:38Z |
| EndTime |
string |
Yes |
The end of the query period. |
2023-04-12T05:38:38Z |
| DbName |
string |
No |
The database name. |
db_**** |
| SearchKeyWord |
string |
No |
The search keyword. |
update |
| SearchParam |
string |
No |
The performance metric to search by. |
cputime |
| SearchRule |
string |
No |
The search operator. |
> |
| SearchValue |
string |
No |
The search value. |
0.01 |
| SqlId |
string |
No |
The SQL ID. |
8D6E84****0B8FB1823D199E2CA1**** |
| NodeIp |
string |
No |
The IP address of the node. |
i-bp19y05uq6x********* |
| FilterCondition |
string |
No |
Use the at sign (@) to reference fields. For a list of available fields, see all columns returned by the Query performance statistics for an SQL statement API. |
@avgCpuTime > 20 and @executions > 100 |
| AcceptLanguage |
string |
No |
The language of the response. |
zh-CN |
| SqlTextLength |
integer |
No |
The maximum length of the returned SQL text. |
65535 |
| Current |
integer |
No |
The page number to return. |
1 |
| PageSize |
integer |
No |
The number of entries to return on each page.
|
10 |
| DynamicSql |
boolean |
No |
Indicates if the SQL statement specified by Note
|
false |
| MergeDynamicSql |
boolean |
No |
Whether to merge the results of dynamic SQL statements. Note
This option aggregates SQL statements that are identical except for the values in their |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response to the request. |
||
| Data |
array<object> |
Suspicious SQL information list. |
|
|
array<object> |
Suspicious SQL information. |
||
| AvgCpuTime |
number |
Average CPU time of suspicious SQL. |
100.24 |
| AvgElapsedTime |
number |
Average response time of suspicious SQL. |
100.28 |
| AvgGetPlanTime |
number |
The average time to obtain execution plans for suspicious SQL. |
0 |
| CpuTime |
number |
CPU time of suspicious SQL. |
100.23 |
| DbName |
string |
Database name. |
db_*** |
| DiagTypes |
array |
Diagnosis type. |
|
|
string |
Diagnosis type. |
[ "CPU_TIME_PROPORTION_HIGH" ] |
|
| Diagnosis |
string |
Diagnosis details. Note
|
- |
| Executions |
number |
The total number of executions of suspicious SQL. |
1 |
| LastExecutedTime |
string |
The last time the suspicious SQL was executed. |
2023-04-12T04:38:38Z |
| RiskLevel |
string |
Risk level. |
high |
| SqlId |
string |
SQL ID. |
8D6E84****0B8FB1823D199E2CA1**** |
| SqlTextShort |
string |
SQL text prefix. |
delete /*+ XXX PARALLEL(4) */ from |
| Suggestion |
string |
Recommendations for suspicious SQL. |
review |
| SumElapsedTime |
number |
The total response time of suspicious SQL. |
11452126.36 |
| UserName |
string |
Username. |
test_user |
| DynamicSql |
boolean |
Whether the SQL is dynamic. |
false |
| SqlList |
array<object> |
SQL list. |
|
|
object |
SQL list. |
||
| AvgCpuTime |
number |
Average CPU time. |
100.24 |
| AvgElapsedTime |
number |
Average response time. |
100.28 |
| AvgGetPlanTime |
number |
Average plan generation time. |
0 |
| CpuTime |
number |
Total CPU time. |
100.23 |
| DbName |
string |
Database name. |
test_hsp****eway |
| DiagTypes |
array |
Diagnosis type. |
|
|
string |
Diagnosis type. |
[ "CPU_TIME_PROPORTION_HIGH" ] |
|
| Diagnosis |
string |
Diagnosis details. Note
|
- |
| Executions |
number |
Total number of executions. |
100 |
| LastExecutedTime |
string |
Last run time. |
2023-04-12T04:38:38Z |
| RiskLevel |
string |
Risk level. |
LOW |
| SqlId |
string |
SQL ID |
3A645****789F13DE0CF6D084FF9**** |
| SqlTextShort |
string |
SQL text. |
select * from test |
| Suggestion |
string |
Suggestions for suspicious SQL. |
{'Role': 'eSG', 'Result': '100', 'Suggestion': 'TRACER_OTHER_ERR'} |
| SumElapsedTime |
number |
Total response time. |
11452126.36 |
| UserName |
string |
Username. |
test_user |
| AvgDbTime |
number |
Average DB time. |
100 |
| SumDbTime |
number |
Total DB time. |
100 |
| AvgRetryCount |
number |
Average retry count. |
4 |
| SumRetryCount |
number |
Total retry count. |
6 |
| AvgLogicalReads |
number |
Average logical read count. |
25 |
| FormatSqlId |
string |
FormatSqlId |
|
| AvgDbTime |
number |
Average DB time. |
100 |
| SumDbTime |
number |
total DB time |
100 |
| AvgRetryCount |
number |
Average retry count. |
4 |
| SumRetryCount |
number |
Total retry count. |
6 |
| AvgLogicalReads |
number |
Average logical read count. |
25 |
| FormatSqlId |
string |
FormatSqlId |
|
| RequestId |
string |
Request ID. |
473469**-AA6F-4D**-B3DB-A*********** |
| TotalCount |
integer |
Total count. |
9 |
Examples
Success response
JSON format
{
"Data": [
{
"AvgCpuTime": 100.24,
"AvgElapsedTime": 100.28,
"AvgGetPlanTime": 0,
"CpuTime": 100.23,
"DbName": "db_***",
"DiagTypes": [
"[\n \"CPU_TIME_PROPORTION_HIGH\"\n]"
],
"Diagnosis": "-",
"Executions": 1,
"LastExecutedTime": "2023-04-12T04:38:38Z",
"RiskLevel": "high",
"SqlId": "8D6E84****0B8FB1823D199E2CA1****",
"SqlTextShort": "delete /*+ XXX PARALLEL(4) */ from",
"Suggestion": "review",
"SumElapsedTime": 11452126.36,
"UserName": "test_user",
"DynamicSql": false,
"SqlList": [
{
"AvgCpuTime": 100.24,
"AvgElapsedTime": 100.28,
"AvgGetPlanTime": 0,
"CpuTime": 100.23,
"DbName": "test_hsp****eway",
"DiagTypes": [
"[\n \"CPU_TIME_PROPORTION_HIGH\"\n ]"
],
"Diagnosis": "-",
"Executions": 100,
"LastExecutedTime": "2023-04-12T04:38:38Z",
"RiskLevel": "LOW",
"SqlId": "3A645****789F13DE0CF6D084FF9****",
"SqlTextShort": "select * from test",
"Suggestion": "{'Role': 'eSG', 'Result': '100', 'Suggestion': 'TRACER_OTHER_ERR'}",
"SumElapsedTime": 11452126.36,
"UserName": "test_user",
"AvgDbTime": 100,
"SumDbTime": 100,
"AvgRetryCount": 4,
"SumRetryCount": 6,
"AvgLogicalReads": 25,
"FormatSqlId": ""
}
],
"AvgDbTime": 100,
"SumDbTime": 100,
"AvgRetryCount": 4,
"SumRetryCount": 6,
"AvgLogicalReads": 25,
"FormatSqlId": ""
}
],
"RequestId": "473469**-AA6F-4D**-B3DB-A***********",
"TotalCount": 9
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.