ApsaraDB for RDS provides the SQL Explorer feature. You can use SQL Explorer to perform security audit and performance diagnostics on your database.

Pricing

  • Trial edition: free. Audit logs are stored for only one day. You can query only data within the last day. This edition does not support advanced features such as data export, and does not guarantee data integrity.
  • 30 days and more: For more information, see Specifications and pricing.

Functions

  • SQL audit log

    Records all operations performed on the database. You can use SQL audit logs to analyze database failures and behaviors and perform security audit.

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

Enable SQL Explorer

  1. Log on to the ApsaraDB for POLARDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Click the ID of the cluster.
  4. In the left-side navigation pane, choose Log and Audit > SQL Explorer.
  5. Click Activate Now.
    Enable now
  6. Select the storage duration of SQL logs, and then click Activate.
    Enable the service

Modify the storage duration of SQL logs

  1. Log on to the ApsaraDB for POLARDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Click the ID of the cluster.
  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 ApsaraDB for POLARDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Click the ID of the cluster.
  4. In the left-side navigation pane, choose Log and Audit > SQL Explorer.
  5. Click Export on the right of the Log Entries section.
  6. In the dialog box that appears, select the items to export and click OK.
    Export SQL records
  7. After the logs are exported, download the log files in the Export SQL Log Records dialog box.
    Download

Disable SQL Explorer

Note

After SQL Explorer is disabled, the SQL logs are cleared. Export SQL logs to your local disk before you disable SQL Explorer.

  1. Log on to the ApsaraDB for POLARDB console.
  2. In the upper-left corner of the console, select the region where the cluster is located.
  3. Click the ID of the cluster.
  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.
    Off

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