By default, the SQL audit and analysis features provided by PolarDB-X are disabled. You can enable the features in the console.
- An Alibaba Cloud account is created and real-name verification is complete.
- Log Service is activated.
The first time you log on to the Log Service console, activate the service by following the on-screen instructions.
- A database is created on the PolarDB-X instance. For more information about how to create a database, see Create a database.
- Log on to the PolarDB-X console.
- In the top navigation bar, select the region where the target instance is located.
- On the Instances page, click the PolarDB-X 2.0 tab.
- Find the target instance and click its ID.
- In the left-side navigation pane, choose .
- On the right side of the page, turn on the switch next to Current Database SQL audit log status.
After the SQL audit feature is enabled, the audit log entries of PolarDB-X databases in the same region are written to the same Logstore. Log Service provides the following default configuration.
|Default configuration item||Description|
|Project||A project whose name is in the
|Logstore||A Logstore named
|Region||The audit log entries of PolarDB-X databases in the same region are written to the same Logstore. For example, the audit
log entries of PolarDB-X databases that are deployed in all zones in the cn-hangzhou region are written to
|Shard||By default, five shards are created and the Manage shards feature is enabled.|
|Index||Indexes are automatically created.
Warning The indexes are automatically updated each time the feature is updated. Do not modify or delete indexes.
|Log retention period||By default, log entries are stored for 45 days. Expired log entries are automatically deleted.|
|Dashboard||By default, the following dashboards are created for PolarDB-X:
For more information about the dashboards, see Log reports.
Note Do not modify the default dashboard configuration. Default dashboards are automatically updated each time the feature is updated. You can create custom dashboards. For more information, see Create a dashboard.