SQL Audit

更新时间:
复制 MD 格式

The AnalyticDB for PostgreSQL console provides the SQL Audit feature. SQL Audit collects information about all Data Manipulation Language (DML) and Data Definition Language (DDL) operations in your database. You can use SQL Audit to view SQL details and regularly audit SQL statements. Enabling this feature does not affect instance performance.

Notes

  • SQL audit records are stored for 14 days. This retention period cannot be changed.

  • Because SQL Audit information is collected by analyzing network protocols, a small number of records may be lost during periods of high SQL query volume.

Procedure

  1. Log on to the AnalyticDB for PostgreSQL console.

  2. In the upper-left corner of the console, select a region.

  3. Find the instance that you want to manage and click the instance ID.

  4. On the instance details page, click Instance Audit in the navigation pane on the left.

  5. Query for SQL information using conditions such as Database Name, Execution Duration, Select Time Range, Database User, Source IP, Execution Status, Operation Category, Operation Type, and Text.

    Note

    You can copy or export the SQL information that is displayed on the current page.

Related API operation

API

Description

DescribeSQLLogCount - Get the number of SQL audit logs

Call the DescribeSQLLogCount operation to get the number of audit logs.