The SQL Explorer feature provides value-added services for your databases, such as security audit and performance diagnostics.
Billing
The trial edition of PolarDB is available for free. In the trial edition, audit logs are retained for only one day. You can query only data that is stored in the retained audit logs. The trial edition does not support advanced features. For example, data cannot be exported, and data integrity cannot be ensured.
If you want to retain the audit logs for 30 days or longer, you can view the pricing details in Pricing of SQL Explorer (optional).
Features
SQL audit logging
You can record all the operations that are performed on your databases. You can use SQL audit logs to perform operations such as fault analysis, behavior analysis, and security audit.
Enhanced search
This feature allows you to search data by using multiple conditions, such as the database, user, client IP, thread ID, execution duration, and execution status. It also allows you to export and download the results.
Enable the SQL Explorer feature
Log on to the PolarDB console.
In the upper-left corner of the console, select the region where your cluster is deployed.
Click the ID of the cluster.
In the left-side navigation pane, choose .
Click Official Edition.
Set the retention period of SQL audit logs and click OK.
Modify the retention period of SQL logs
Log on to the PolarDB console.
In the upper-left corner of the console, select the region where your cluster is deployed.
Click the ID of the cluster.
In the left-side navigation pane, choose .
In the upper-right corner of the SQL Explorer page, click Service Settings.
Modify the storage duration 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 your cluster is deployed.
Click the ID of the cluster.
In the left-side navigation pane, choose .
Click Export on the right.
In the dialog box that appears, set Export Field and Time Range, and then click OK.
After the export is complete, download the exported file in the Export SQL Log Records dialog box, and save it properly.
Disable the SQL Explorer feature
After you disable the SQL Explorer feature, all SQL audit logs are deleted. Export SQL audit logs before you disable SQL Explorer.
Log on to the PolarDB console.
In the upper-left corner of the console, select the region where your cluster is deployed.
Click the ID of the cluster.
In the left-side navigation pane, choose .
In the upper-right corner of the SQL Explorer page, click Service Settings.
Modify the storage duration and click OK.
Turn off the SQL Explorer switch.
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.