All Products
Search
Document Center

PolarDB:SQL Explorer

Last Updated:Sep 13, 2023

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 Pricing of SQL Explorer (optional).

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

  5. View the billing details in the data entries in which the value in the Billing Item column is sql_explorer.