All Products
Search
Document Center

AnalyticDB:DescribeAbnormalPatternDetection

Last Updated:Aug 28, 2026

Detects SQL patterns with abnormal execution metrics within a specified time range.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

adb:DescribeAbnormalPatternDetection

get

DBCluster

acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

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

RegionId

string

Yes

The region ID.

Note

You can call the DescribeRegions operation to query the most recent region list.

cn-shenzhen

StartTime

string

No

The start 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

EndTime

string

No

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

Lang

string

No

The language. Valid values:

  • zh (default): simplified Chinese.

  • en: English.

zh

Response elements

Element

Type

Description

Example

object

The response parameters.

TotalCount

string

The total number of entries returned.

300

RequestId

string

The request ID.

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

DBClusterId

string

The cluster ID.

am-xxxx

DetectionItems

array<object>

The detection items and their results.

array<object>

A single detection item and its result.

Name

string

The name of the detection item.

Cost,PeakMemory

Results

array<object>

The detection result.

object

A single detection result entry.

PatternId

string

The SQL pattern ID.

5495577090378760322

SQLPattern

string

The representative SQL statement of the pattern.

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

Detail

string

The detection report details for the SQL pattern.

{}

RelatedMetrics

string

The metrics related to the SQL pattern.

Maximum query time:1.43s Maximum peak memory:20.73MB Maximum table read data volume:10.12MB

User

string

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

test

AccessIp

string

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

11.81.238.102

Tables

string

The names of tables.

ad_marketing_engine.prod_dws_oe_promotion_daily_trend_report

QueryCount

integer

The number of executed SQL patterns within the time range.

72

FailedCount

integer

The number of failed SQL patterns within the time range.

63

Status

string

The severity level of the detection result. Valid values:

  • NORMAL

  • WARNING

  • CRITICAL

NORMAL WARNNING CRITICAL

Message

string

The description of the detection result.

Detected 2 totalTime metric anomaly patterns that may cause increased CPU usage or slower queries and affect system stability. Go to the monitoring page to use the one-click diagnosis feature to view details and optimize.

Examples

Success response

JSON format

{
  "TotalCount": "300",
  "RequestId": "36B66482-A215-5F04-A42E-859983D89D7B",
  "DBClusterId": "am-xxxx",
  "DetectionItems": [
    {
      "Name": "Cost,PeakMemory",
      "Results": [
        {
          "PatternId": "5495577090378760322",
          "SQLPattern": "SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?",
          "Detail": "{}",
          "RelatedMetrics": "Maximum query time:1.43s\nMaximum peak memory:20.73MB\nMaximum table read data volume:10.12MB",
          "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": "Detected 2 totalTime metric anomaly patterns that may cause increased CPU usage or slower queries and affect system stability. Go to the monitoring page to use the one-click diagnosis feature to view details and optimize."
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The specified DBClusterId parameter does not exist. Make sure that the DBClusterId value is valid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.