Apsara PolarDB provides the SQL Explorer feature. You can use SQL Explorer for database security auditing and performance diagnostics.

Pricing

  • The trial edition of Apsara 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 Specifications and pricing.

Features

  • SQL logging

    SQL audit logs record all operations that are performed on databases. You can use audit logs to identify database failures, analyze behaviors, and perform security auditing.

  • Advanced search
    SQL Explorer allows you to search data by database, user, client IP, thread ID, execution duration, or execution status. You can also export and download search results.SQL Explorer

Enable SQL Explorer

  1. Log on to the Apsara PolarDB console.
  2. In the upper-left corner of the console, select the region where the target cluster resides.
  3. Find the target cluster and click its ID.
  4. In the left-side navigation pane, choose Log and Audit > SQL Explorer.
  5. Click Activate Now.Enable SQL Explorer
  6. Specify the storage duration of SQL audit logs, and then click Activate.Storage duration

Change the storage duration of SQL audit logs

  1. Log on to the Apsara PolarDB console.
  2. In the upper-left corner of the console, select the region where the target cluster resides.
  3. Find the target cluster and click its ID.
  4. In the left-side navigation pane, choose Log and Audit > SQL Explorer.
  5. In the upper-right corner of the page, click Service Settings.
  6. Change the storage duration and click OK.

Export SQL records

  1. Log on to the Apsara PolarDB console.
  2. In the upper-left corner of the console, select the region where the target cluster resides.
  3. Find the target cluster and click its ID.
  4. In the left-side navigation pane, choose Log and Audit > SQL Explorer.
  5. On the right side of the page, click Export.
  6. In the dialog box that appears, specify the Export Field and Time Range parameters, and click OK.Export records
  7. After the export is complete, download the log files in the Export SQL Log Records dialog box.Download and export records

Disable SQL Explorer

Note

After SQL Explorer is disabled, SQL audit logs are deleted. We recommend that you export and save SQL log files to your computer before you disable SQL Explorer.

  1. Log on to the Apsara PolarDB console.
  2. In the upper-left corner of the console, select the region where the target cluster resides.
  3. Find the target cluster and click its ID.
  4. In the left-side navigation pane, choose Log and Audit > SQL Explorer.
  5. In the upper-right corner of the page, click Service Settings.
  6. Change the storage duration and click OK.
  7. Turn off the Activate SQL Explorer switch.Service Settings

View the size and consumption details of audit logs

  1. Log on to the Alibaba Cloud console.
  2. In the upper-right corner of the page, choose Billing > User Center.
  3. In the left-side navigation pane, choose Spending Summary > Instance Spending Detail.
  4. Click on Click here to experience the new version.
    User Center
    Note Skip this step if you have switched to the new version.
  5. Click the Details tab, select Instance Name from the drop-down list, enter the instance name in the search box, and click Search.
    Details
  6. View the billing details whose Billing Item is sql_explorer.