SQL Audit
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
-
Log on to the AnalyticDB for PostgreSQL console.
-
In the upper-left corner of the console, select a region.
-
Find the instance that you want to manage and click the instance ID.
On the instance details page, click Instance Audit in the navigation pane on the left.
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.
NoteYou can copy or export the SQL information that is displayed on the current page.
Related API operation
API | Description |
Call the DescribeSQLLogCount operation to get the number of audit logs. |