Enable SQL Audit and Analysis

更新时间:
复制 MD 格式

The SQL Audit and Analysis feature for PolarDB-X is disabled by default. You can enable this feature in the console.

Prerequisites

Procedure

  1. Log on to the PolarDB-X console.

  2. In the top navigation bar, select the region where the instance is deployed.

  3. On the Instances page, click the PolarDB-X 2.0 tab.

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

  5. In the navigation pane on the left, click Diagnostics and Optimization > SQL Audit and Analysis.

  6. 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.

Warning

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 polardbx-sqlaudit-<Region ID>-<Alibaba Cloud account ID>. For example, polardbx-sqlaudit-cn-hangzhou-123456789.

Logstore

A Logstore named polardbx-sqlaudit-log is created by default.

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 polardbx-sqlaudit-cn-hangzhou-<Alibaba Cloud account ID> in Simple Log Service.

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:

  • Operations Hub

  • Performance Center

  • Security Center

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.