The SQL Audit and Analysis feature for PolarDB-X is disabled by default. You can enable this feature in the console.
Prerequisites
You have an Alibaba Cloud account that has passed identity verification.
You have activated Simple Log Service.
When you log on to the Simple Log Service console for the first time, follow the on-screen instructions to activate Simple Log Service.
You have created a database in the target PolarDB-X instance.
Procedure
Log on to the PolarDB-X console.
In the top navigation bar, select the region where the instance is deployed.
On the Instances page, click the PolarDB-X 2.0 tab.
Find the instance that you want to manage and click its ID.
In the navigation pane on the left, click .
In the upper-right corner of the page, turn on the SQL Audit Log Status for Current DB switch.
Results
After you enable SQL Audit and Analysis, the audit logs of PolarDB-X databases in the same region are written to the same Logstore in Simple Log Service. Simple Log Service also creates the following default configurations.
Simple Log Service periodically updates and upgrades the SQL Audit and Analysis feature. The indexes and default reports for the dedicated Logstore are also automatically updated. Therefore, do not delete or modify the default Project, Logstore, indexes, or dashboards that Simple Log Service creates.
Default configuration item | Configuration details |
Project | A Project is created by default. The Project is named |
Logstore | A Logstore named |
Region | The audit logs of PolarDB-X databases in the same region are written to the same Logstore in Simple Log Service. For example, the audit logs of PolarDB-X databases in all zones within the China (Hangzhou) region are written to the Logstore |
Shard | Five shards are created by default, and the Manage Shard feature is enabled. |
Index | Simple Log Service automatically creates indexes. Warning The index settings are automatically updated with feature upgrades. Do not manually modify or delete the indexes. |
Log storage duration | Logs are stored for 45 days by default. Logs older than 45 days are automatically deleted. |
Dashboard | PolarDB-X creates the following three default dashboards:
For more information about dashboards, see Log Reports. Note Do not modify the default dashboard configurations. The default dashboards are automatically updated with feature upgrades. You can also create custom dashboards. For more information, see Create a dashboard. |