All Products
Search
Document Center

AnalyticDB:DescribeAbnormalPatternDetection

Last Updated:Jan 08, 2026

Queries abnormal SQL patterns within a time range.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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.
OperationAccess levelResource typeCondition keyAssociated operation
adb:DescribeAbnormalPatternDetectionget
DBCluster
acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The cluster ID.

Note You can call the DescribeDBClusters operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.
am-xxxx
RegionIdstringYes

The region ID.

Note You can call the DescribeRegions operation to query the most recent region list.
cn-shenzhen
StartTimestringYes

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2011-06-01T16:00Z
EndTimestringYes

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2021-05-18T06:30Z
LangstringNo

The language. Valid values:

  • zh (default): simplified Chinese.
  • en: English.
zh

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

TotalCountstring

The total number of entries returned.

300
RequestIdstring

The request ID.

36B66482-A215-5F04-A42E-859983D89D7B
DBClusterIdstring

The cluster ID.

am-xxxx
DetectionItemsarray<object>

The queried detection items and detection results.

OpenApiFasDetectionItemobject

The queried detection item and detection result.

Namestring

The name of the detection item.

Cost,PeakMemory
Resultsarray<object>

The detection result.

AbnormalPatternsobject

The detection result items.

PatternIdstring

The SQL pattern ID.

5495577090378760322
SQLPatternstring

The SQL statement that represents the SQL pattern.

SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?
Detailstring

The details about the detection report of the SQL pattern.

{}
RelatedMetricsstring

The metrics related to the SQL pattern.

Maximum query duration: 1.43s Maximum peak memory: 20.73 MB Maximum read table data: 10.12 MB
Userstring

The name of the database account that is used to submit the query.

test
AccessIpstring

The IP address of the SQL client that submits the SQL pattern.

11.81.238.102
Tablesstring

The names of tables.

ad_marketing_engine.prod_dws_oe_promotion_daily_trend_report
QueryCountlong

The number of executed SQL patterns within the time range.

72
FailedCountlong

The number of failed SQL patterns within the time range.

63
Statusstring

The severity level of the detection result. Valid values:

  • NORMAL
  • WARNING
  • CRITICAL
NORMAL WARNNING CRITICAL
Messagestring

The description of the detection result.

Two SQL patterns that have abnormal totalTime metric values are detected. This may result in increased CPU utilization, query slowdown, and degraded system stability. Go to the monitoring page to diagnose the issue and then perform optimization.

Examples

Sample success responses

JSONformat

{
  "TotalCount": 300,
  "RequestId": "36B66482-A215-5F04-A42E-859983D89D7B",
  "DBClusterId": "am-xxxx",
  "DetectionItems": [
    {
      "Name": "Cost,PeakMemory",
      "Results": [
        {
          "PatternId": 5495577090378760000,
          "SQLPattern": "SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?",
          "Detail": {},
          "RelatedMetrics": "Maximum query duration: 1.43s\nMaximum peak memory: 20.73 MB\nMaximum read table data: 10.12 MB",
          "User": "test",
          "AccessIp": "11.81.238.102",
          "Tables": "ad_marketing_engine.prod_dws_oe_promotion_daily_trend_report",
          "QueryCount": 72,
          "FailedCount": 63
        }
      ],
      "Status": "NORMAL\nWARNNING\nCRITICAL",
      "Message": "Two SQL patterns that have abnormal totalTime metric values are detected. This may result in increased CPU utilization, query slowdown, and degraded system stability. Go to the monitoring page to diagnose the issue and then perform optimization."
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The specified DBClusterId parameter does not exist. Make sure that the DBClusterId value is valid.

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