All Products
Search
Document Center

Database Autonomy Service:GetDasSQLLogHotData

Last Updated:Apr 25, 2024

Queries the details of the hot storage data that the new SQL Explorer and Audit feature generates for a database instance within the last seven days.

Operation description

Before you call this operation, take note of the following items:

  • If you use Alibaba Cloud SDK or Database Autonomy Service (DAS) SDK to call this operation, we recommend that you use the latest version of the SDK.
  • If you use an SDK to call operations of DAS, you must set the region ID to cn-shanghai.
  • An ApsaraDB RDS for MySQL database or a PolarDB for MySQL database in the China (Shanghai) region is connected to DAS.
  • The new SQL Explorer and Audit feature is enabled for the database instance. For more information, see the Enable the SQL Explorer and Audit feature section of the "Overview" topic.
Note You can query only the data that is generated after the new SQL Explorer and Audit feature is enabled. The start time can be up to seven days earlier than the current time. The interval between the start time and the end time cannot exceed 24 hours.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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
hdm:GetDasSQLLogHotDataRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the database instance.

rm-2ze1jdv45i7l6****
StartlongYes

The beginning of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Note You can query only the data that is generated after the new SQL Explorer and Audit feature is enabled. The start time can be up to seven days earlier than the current time.
1684734297000
EndlongYes

The end of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Note The end time must be later than the start time. The interval between the start time and the end time cannot exceed 24 hours.
1684820697000
QueryKeywordstringNo

The keyword that is used for the query.

Note The keyword must be at least four characters in length. You can specify multiple keywords that are separated by spaces. Fuzzy queries are not supported.
test
AccountNamestringNo

The account of the database.

Note You can specify multiple database accounts that are separated by spaces. Example: user1 user2 user3.
testuser
DBNamestringNo

The name of the database.

Note You can specify multiple database names that are separated by spaces. Example: DB1 DB2 DB3.
testDB
HostAddressstringNo

The IP address of the client.

Note You can specify multiple IP addresses that are separated by spaces. Example: IP1 IP2 IP3.
47.100.XX.XX
LogicalOperatorstringNo

The logical relationship among multiple keywords.

  • or
  • and
or
MaxLatancylongNo

The maximum execution duration. Unit: microseconds. You can specify this parameter to query the SQL statements whose execution duration is smaller than the value of this parameter.

100
MaxScanRowslongNo

The maximum number of scanned rows. You can specify this parameter to query the SQL statements that scan a smaller number of rows than the value of this parameter.

10000
MinLatancylongNo

The minimum execution duration. Unit: microseconds. You can specify this parameter to query the SQL statements whose execution duration is greater than or equal to the value of this parameter.

10
MinScanRowslongNo

The minimum number of scanned rows. You can specify this parameter to query the SQL statements that scan a larger or an equal number of rows than the value of this parameter.

10
SqlTypestringNo

The type of the SQL statement. Valid values:

  • SELECT
  • UPDATE
  • DELETE
SELECT
StatestringNo

The execution results. You can specify 0 to query the SQL statements that are successfully executed. You can also specify an error code to query the corresponding SQL statements that fail to be executed.

0
ThreadIDstringNo

The thread ID.

Note You can specify multiple thread IDs that are separated by spaces. Example: Thread ID1 Thread ID2 Thread ID3.
657
PageNumberslongNo

The page number. Pages start from page 1. Default value: 1.

2
MaxRecordsPerPagelongNo

The maximum number of entries per page. Valid values: 5 to 100.

10
SortKeystringNo

The basis on which you want to sort the query results.

  • SCAN_ROWS: the number of scanned rows.
  • UPDATE_ROWS: the number of updated rows.
  • CONSUME: the time consumed.
  • ORIGIN_TIME: the execution duration.
SCAN_ROWS
SortMethodstringNo

The order in which you want to sort the query results.

  • ase: ascending order.
  • desc: descending order.
ase
ChildDBInstanceIDsstringNo

The node ID.

Note This parameter must be specified if the database instance is a PolarDB for MySQL cluster.
pi-bp179lg03445l****
RolestringNo

The reserved parameter. This parameter is not supported.

None
TraceIdstringNo

The reserved parameter. This parameter is not supported.

None
MinRowslongNo

The reserved parameter. This parameter is not supported.

None
MaxRowslongNo

The reserved parameter. This parameter is not supported.

None
MinSpillCntlongNo

The reserved parameter. This parameter is not supported.

None
MaxSpillCntlongNo

The reserved parameter. This parameter is not supported.

None
TransactionIdstringNo

The transaction ID.

0
FailstringNo

The error code of SQL execution. You can call the GetAsyncErrorRequestStatByCode operation to query MySQL error codes in SQL Explorer data.

1064

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The HTTP status code returned.

200
Messagestring

The returned message.

Note If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned.
Successful
RequestIdstring

The request ID.

0A74B755-98B7-59DB-8724-1321B394****
Successstring

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Dataobject

The data returned.

Listobject []

The details of the data returned.

Latancylong

The execution duration. Unit: microseconds.

10000
Extstring

The extended information. This parameter is a reserved parameter.

None
ExecuteTimestring

The execution time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2023-05-23 T12:11:20Z
OriginTimestring

The execution time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2023-05-23 T12:11:20.999Z
HostAddressstring

The IP address of the client.

47.100.XX.XX
UpdateRowslong

The number of updated rows.

30
LogicReadlong

The number of logical reads.

12
SQLTextstring

The content of the SQL statement.

select 1
LockTimelong

The lock wait duration. Unit: microseconds.

1
ScanRowslong

The number of rows scanned by the SQL statement.

29
ThreadIDlong

The thread ID.

657
Statestring

The execution result. If a 0 is returned, the SQL statement was successfully executed. If an error code is returned, the SQL statement failed to be executed.

0
DBNamestring

The name of the database.

testDB
SqlTypestring

The type of the SQL statement. Valid values:

  • SELECT
  • UPDATE
  • DELETE
SELECT
AccountNamestring

The account of the database.

testuser
PhysicSyncReadlong

The number of physical synchronous reads.

0
PhysicAsyncReadlong

The number of physical asynchronous reads.

0
TransactionIdstring

The transaction ID.

0
ReturnRowslong

The number of rows returned.

1
Totallong

The total number of entries returned.

20
PageNolong

The page number.

2
PageSizelong

The number of entries per page.

10
Extraany

The reserved parameter.

None

Examples

Sample success responses

JSONformat

{
  "Code": "200",
  "Message": "Successful",
  "RequestId": "0A74B755-98B7-59DB-8724-1321B394****",
  "Success": "true",
  "Data": {
    "List": [
      {
        "Latancy": 10000,
        "Ext": "None",
        "ExecuteTime": "2023-05-23 T12:11:20Z",
        "OriginTime": "2023-05-23 T12:11:20.999Z",
        "HostAddress": "47.100.XX.XX",
        "UpdateRows": 30,
        "LogicRead": 12,
        "SQLText": "select 1",
        "LockTime": 1,
        "ScanRows": 29,
        "ThreadID": 657,
        "State": "0",
        "DBName": "testDB",
        "SqlType": "SELECT",
        "AccountName": "testuser",
        "PhysicSyncRead": 0,
        "PhysicAsyncRead": 0,
        "TransactionId": "0",
        "ReturnRows": 1
      }
    ],
    "Total": 20,
    "PageNo": 2,
    "PageSize": 10,
    "Extra": "None"
  }
}

Error codes

HTTP status codeError codeError message
400InvalidParamsThe request parameters are invalid.
403NoPermissionYou are not authorized to do this action.

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

Change history

Change timeSummary of changesOperation
No change history