The SQL Explorer feature provides value-added services for your databases, such as security audit and performance diagnostics.

Billing description

You are charged for the storage space that is consumed by audit logs.
  • Mainland China: USD 0.0013/GB/hour.
  • China (Hong Kong) and regions outside China: USD 0.0019/GB/hour.
Note The storage space that is consumed by audit logs is billed on a pay-as-you-go basis, and cannot be billed by using the subscription billing method. For more information, see Billable items.

Feature description

  • SQL audit log

    Records all the operations that are performed on databases. You can use audit log records to perform operations on the databases, such as fault analysis, behavior analysis, and security audit.

  • Enhanced search
    Allows you to search data by database, user, client IP, thread ID, execution duration, execution status, and other dimensions, and then export and download the search results.Search
  • SQL analysis
    Provides a visualized and interactive method for you to analyze SQL log entries that are generated within the specified time period. You can use this feature to locate problematic SQL statements and performance issues.AnalysisNumber of executions

Enable SQL Explorer

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

Change the storage duration of SQL logs

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

Export SQL records

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster resides.
  3. Find the cluster, and then click the cluster ID.
  4. In the left-side navigation pane, choose Log and Audit > SQL Explorer.
  5. Click Export on the right.
  6. In the dialog box that appears, select the items that you want to export and click Ok.
    Export SQL records
  7. After the logs are exported, in the Export SQL Log Records panel, download the exported files and keep them secure.
    Download

Disable SQL Explorer

Note

After SQL Explorer is disabled, SQL audit logs are cleared. Export SQL audit logs before you disable SQL Explorer.

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster resides.
  3. Find the cluster, and then click the cluster ID.
  4. In the left-side navigation pane, choose Log and Audit > SQL Explorer.
  5. Click Service Settings.
  6. Turn off the Activate SQL Explorer switch.
    Disable

View the size and consumption details of audit logs

  1. Log on to the Alibaba Cloud Management Console.
  2. In the upper-right corner of the page, choose Expenses > User Center.
  3. In the left-side navigation pane, choose Spending Summary > Spending Summary.
  4. Click 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. Specify Instance ID to search for the desired instance.
    Details
  6. View the billing details of which Billing Item is sql_explorer.