SQL Explorer and Audit

Updated at:

SQL Explorer and Audit is a module in Database Autonomy Service (DAS) that gives you full visibility into SQL activity on your database instance. It combines request analysis, diagnostics, and security auditing so you can investigate performance issues, detect security risks, and validate capacity before peak traffic hits.

Supported databases and regions

The SQL Explorer and Audit feature is available only after you enable DAS Enterprise Edition. The supported databases and regions vary by edition. For a list of the databases and regions supported by each edition, see Supported databases and regions for each edition.

Billing

  • You can use the SQL Explorer and Audit feature only after you enable DAS Enterprise Edition. For information about the billing of different editions, see Product billing.

  • After you enable SQL Explorer and Audit, in addition to the base fee of DAS Enterprise Edition, a separate storage fee continues to be incurred based on the volume of SQL logs stored. To stop this storage billing, you must manually disable SQL Explorer and Audit in the DAS console or in the console of the database that uses SQL Explorer and Audit. Performing only the following operations does not stop this storage billing:

    • Disabling DAS Agent

    • Canceling the auto-renewal of DAS Enterprise Edition

Enable SQL Explorer and Audit

Note

If you have already enabled DAS Enterprise Edition for a database instance, the SQL Explorer and Audit feature is enabled automatically. For more information, see Enable DAS Enterprise Edition.

  1. Log on to the DAS console.

  2. In the navigation pane on the left, click Intelligent O&M Center > Instance Monitoring .

  3. Find the target instance and click the instance ID to open the instance details page.

  4. In the left-side navigation pane, click Request Analysis > SQL Explorer and Audit.

  5. On the SQL Explorer and Audit page, enable the SQL Explorer and Audit feature.

    If DAS Enterprise Edition is not enabled for your Alibaba Cloud account, follow the on-screen instructions to enable it. For more information, see Enable DAS Enterprise Edition.

What SQL Explorer and Audit provides

After SQL Explorer and Audit is enabled, navigate to Request Analysis > SQL Explorer and Audit to access the following features:

FeatureWhat it does
SearchRetain a full audit trail: query and export SQL statements along with execution metadata — database name, request status, and execution duration. For details, see Search (Audit).
SQL ExplorerReport on database activity: diagnose SQL health, troubleshoot performance issues, and analyze business traffic patterns. For details, see SQL Explorer.
Security auditAnalyze security risks: automatically detect high-risk SQL statements, SQL injection attacks, and new access sources. For details, see Security audit.
Traffic playback and stress testingValidate capacity: replay production traffic against your instance to determine whether you need to scale up or scale out before peak hours. For details, see Traffic playback and stress testing.
SQL ReviewRun global workload analysis to identify suspicious SQL statements and get optimization suggestions. For details, see SQL Review.
Transaction analysisRetrieve transaction type, count, and details for a thread within a specified time range — useful for optimizing database performance at the transaction level. For details, see Transaction analysis.
Quick transaction analysisIdentify the start and end SQL statements of the transaction that contains a target SQL statement, and check its commit or rollback status. For details, see Quick transaction analysis.

Change the data retention period

Warning

If you reduce the data retention period, DAS immediately deletes all sql audit logs older than the new period. We recommend that you export and save the sql audit logs to a local device before you reduce the data retention period.

  1. Log on to the DAS console.

  2. In the navigation pane on the left, click Intelligent O&M Center > Instance Monitoring .

  3. Find the target instance and click the instance ID to open the instance details page.

  4. In the left-side navigation pane, click Request Analysis > SQL Explorer and Audit.

  5. On the SQL Explorer and Audit page, click Service Settings.

  6. Change the retention period and click Submit.

    If you have enabled DAS Enterprise Edition V3, you can change the data retention period for different sub-features.

    Note
    • You can also set the Data Storage Duration for SQL Explorer and Audit on the DAS Professional Edition Management page. For more information, see Manage DAS Enterprise Edition.

    • The storage space for SQL Explorer and Audit data is provided by DAS and does not use your database instance's storage space.

Disable SQL Explorer and Audit

Warning

Disabling the SQL Explorer and Audit feature does not affect your services, but it deletes all sql audit logs. We recommend that you export and save the sql audit logs to a local device before you disable this feature. If you enable the feature again, sql audit logs will be recorded from the time of re-enablement.

  1. Log on to the DAS console.

  2. In the navigation pane on the left, click Intelligent O&M Center > Instance Monitoring .

  3. Find the target instance and click the instance ID to open the instance details page.

  4. In the left-side navigation pane, click Request Analysis > SQL Explorer and Audit.

  5. On the SQL Explorer and Audit page, click Search.

  6. In the log list area of the Search tab, click Export.

  7. In the dialog box that appears, select the fields to export and the time range.

  8. Download the exported file and save it to a secure location.

    The data download process varies by DAS Enterprise Edition.

    • On the Search tab, download the exported file from the View Exported Logs.

    • On the Task list tab, download the exported file.

  9. Click Service Settings to disable SQL Explorer and Audit.

    If you have enabled DAS Enterprise Edition V3, deselect all features for SQL Explorer and Audit, and then click Submit.

    Note

    Approximately one hour after you disable the SQL Explorer and Audit feature, the system releases the storage space used for its data.