All Products
Search
Document Center

AnalyticDB for PostgreSQL:Enable SQL audit

Last Updated:Jan 02, 2024

AnalyticDB for PostgreSQL provides the SQL audit feature to collect statistics on all DML and DDL operations. You can use the SQL audit feature to view details about SQL statements and audit SQL statements on a regular basis. The SQL audit feature does not affect instance performance.

Usage notes

  • SQL audit logs can be retained for 14 days. This retention period cannot be modified.

  • SQL audit records are obtained from network protocol analysis. A small number of records may be lost if a large amount of data is queried.

Procedure

  1. Log on to the AnalyticDB for PostgreSQL console.

  2. In the upper-left corner of the console, select the region where the instance resides.

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

  4. In the left-side navigation pane, click Instance Audit.

  5. Search SQL information by Database Name, Execution Duration, Select Time Range, Database User, Source IP, Execution Status, Operation Category, Operation Type, and Text.

    Note

    You can copy and export SQL information from SQL details on the current page.

Related operations

Operation

Description

DescribeSQLLogCount

Queries the number of audit logs.