PolarDB for MySQL provides the SQL Explorer feature that integrates the specific features of Database Autonomy Service (DAS).
You can enable SQL Explorer to use the search, SQL Explorer, and security audit features of DAS Professional Edition in a convenient manner. This helps you obtain
the details about SQL statements, troubleshoot performance issues, and identify the
sources of high-risk SQL statements. In addition, the traffic playback and stress testing feature is also provided to help you verify whether your instance type needs to be
scaled up or scaled out to handle traffic spikes.
Billing
You are charged for SQL Explorer based on the storage of audit logs.
- Mainland China: USD 0.0013/GB/hour
- China (Hong Kong) and regions outside China: USD 0.0019/GB/hour
Note The storage of audit logs is billed based on the pay-as-you-go billing method. The
subscription billing method is not supported. For more information, see
Pricing of SQL Explorer (optional).
Overview
- Advanced search
The search feature allows you to query and export SQL statements and the related information.
The information includes databases, states, and execution duration. For more information,
see Search.
- SQL Explorer
The SQL Explorer feature is used to diagnose the health status of SQL statements,
troubleshoot performance issues, and analyze business traffic. For more information,
see SQL Explorer.
- Security auditing
The security audit feature is used to automatically identify risks such as high-risk
SQL statements, SQL injections, and new request sources. For more information, see
Security audit.
- Traffic playback and stress testing
The traffic playback and stress test feature supports traffic playback and stress
testing. You can use this feature to check whether you need to upgrade your RDS instance
to handle traffic spikes during peak hours. For more information, see Traffic playback and stress testing.
Enable the SQL Explorer feature
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster that
you want to manage is deployed.
- Find the cluster you want to manage and click the cluster ID.
- In the left-side navigation pane, choose .
- Click Enable.
- If you do not have DAS Professional Edition, click Buy to purchase DAS Professional Edition. Then, activate DAS Professional Edition.
- If you have DAS Professional Edition, click Enable Professional Edition.
After DAS Professional Edition is activated, you can use the
search,
SQL Explorer,
security audit, and
traffic playback and stress testing features of DAS Professional Edition.

Change the retention period of SQL logs
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster that
you want to manage is deployed.
- Find the cluster you want to manage and click the cluster ID.
- In the left-side navigation pane, choose .
- In the upper-right corner of the SQL Explorer page, click Service Settings.
- Change the retention period and click Ok.
Export SQL log entries
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster that
you want to manage is deployed.
- Find the cluster you want to manage and click the cluster ID.
- In the left-side navigation pane, choose .
- On the right side of Logs, click Export.
- In the Export SQL Records dialog box, select the required fields, specify the time range, and then click Ok.
- After log entries are exported, you can click Download in the Export SQL Log Entries panel to export SQL log entries to a
.csv
file.
- Click OK.
Disable the SQL Explorer feature
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster that
you want to manage is deployed.
- Find the cluster you want to manage and click the cluster ID.
- In the left-side navigation pane, choose .
- Click Service Settings.
- In the dialog box that appears, turn off the Enable switch and click Ok.

Note After you disable the SQL Explorer feature, all SQL log entries are deleted. We recommend
that you export SQL log entries before you disable this feature. For more information
about how to export SQL log entries, see
Export SQL log entries.
- In the message that appears, click OK.
View the size and consumption details of audit logs
- Log on to the Alibaba Cloud Management Console.
- In the upper-right corner of the page, choose Expenses > User Center.
- In the left-side navigation pane, choose .
- On the Bills page, click the Details tab. In the search bar, select Instance ID from the drop-down list and enter the ID of the cluster for which you want to query
the details.
- View the billing details in the data entries in which the value in the Billing Item column is sql_explorer.