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.
- SQL audit logs can be retained for 30 days.
- SQL audit records are obtained from network protocol analysis, and a small number of records may be lost if a large amount of data is queried.
- Log on to the AnalyticDB for PostgreSQL console.
- In the upper-left corner of the console, select the region where the instance resides.
- Find the instance that you want to manage and click the instance ID.
- In the left-side navigation pane, click SQL Audit.
- On the SQL Audit tab, 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.
|DescribeSQLLogs||Queries SQL logs within a specific time range.|
|DescribeSQLLogCount||Queries the number of audit logs.|