All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeSqlAuditStat

Last Updated:Nov 14, 2025

You can call this operation to collect the execution statistics of an SQL statement by client IP address, user, and SQL statement ID.

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
oceanbase:DescribeSqlAuditStatnone
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringNo

The ID of the OceanBase cluster.

ob317v4uif****
TenantIdstringNo

The ID of the tenant.

t33h8y08k****
StartTimestringNo

The start time, in the format of yyyy-MM-dd'T'HH:mm:ss'Z'.

2025-01-14T02:34:49Z
EndTimestringNo

The end time, in the format of yyyy-MM-dd'T'HH:mm:ss'Z' . The time range cannot exceed 6 hours.

2025-01-14T03:34:49Z
PageSizeintegerNo

The number of rows to return on each page.

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

The number of the page to return.

  • Pages start from page 1.
  • Default value: 1.
1
OperatorTypestringNo

The type of the operation.

INSERT

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

Id of the request

EE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C
Dataarray<object>

The returned data.

Dataobject

The returned data.

InstanceIdstring

The ID of the cluster instance.

ob317v4uif****
TenantIdstring

The ID of the tenant.

t33h8y08k****
UserClientIpstring

The IP address of the client.

xx.xx.xx.xx
UserNamestring

The username.

test_mysql
DatabaseNamestring

The name of the database

test_database_1
SqlIdstring

The ID of the SQL statement.

8D6E84****0B8FB1823D199E2CA1****
TotalSucceedlong

The total number of successful executions.

1
TotalFailedlong

The total number of failed executions.

0
TotalAffectRowslong

The total number of affected rows.

1
TotalScanRowslong

The total number of scanned rows.

10
TotalReturnRowslong

The total number of returned rows.

1
AffectRowsdouble

The average number of affected rows. SQL executions that affect 0 rows are excluded from the calculation. The value is rounded off.

1
ScanRowsdouble

The average number of scanned rows. SQL executions that affect 0 rows are excluded from the calculation. The value is rounded off.

1
ReturnRowsdouble

The average number of returned rows. SQL executions that affect 0 rows are excluded from the calculation. The value is rounded off.

1
ExecuteTimedouble

The average execution time, in ms.

142
SqlStatementstring

The SQL template.

UPDATE `oceanbase_test_table` SET `name` = ? WHERE `key` = ?
OperatorTypestring

The type of the operation.

UPDATE
TotalCountlong

The total count.

9

Examples

Sample success responses

JSONformat

{
  "RequestId": "\t\nEE205C00-30E4-XXXX-XXXX-87E3A8A2AA0C\n",
  "Data": [
    {
      "InstanceId": "ob317v4uif****",
      "TenantId": "t33h8y08k****",
      "UserClientIp": "xx.xx.xx.xx\n",
      "UserName": "test_mysql ",
      "DatabaseName": "test_database_1",
      "SqlId": "8D6E84****0B8FB1823D199E2CA1****",
      "TotalSucceed": 1,
      "TotalFailed": 0,
      "TotalAffectRows": 1,
      "TotalScanRows": 10,
      "TotalReturnRows": 1,
      "AffectRows": 1,
      "ScanRows": 1,
      "ReturnRows": 1,
      "ExecuteTime": 142,
      "SqlStatement": "UPDATE `oceanbase_test_table` SET `name` = ? WHERE `key` = ?",
      "OperatorType": "UPDATE"
    }
  ],
  "TotalCount": 9
}

Error codes

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

Change history

Change timeSummary of changesOperation
2025-07-03The request parameters of the API has changed. The response structure of the API has changedView Change Details