SQL Explorer and Audit

更新时间:
复制 MD 格式

Database Autonomy Service (DAS) provides the SQL Explorer and Audit feature for PolarDB-X 2.0. This feature captures all requests and integrates search and SQL Explorer to help you retrieve detailed SQL statement information and troubleshoot performance issues. It also offers traffic playback and stress testing to evaluate whether your instance needs scaling for peak business traffic.

Supported databases and regions

Database

Region

PolarDB-X 2.0

China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), and Singapore

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.

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.

Use SQL Explorer and Audit

  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. You can use the following features:

    • Search: Query and export SQL statements and related information, such as the database, status, and execution duration. For more information, see Audit.

    • ️SQL Explorer: Diagnose SQL health, troubleshoot performance issues, and analyze business traffic. For more information, see SQL Explorer.

    • Traffic Playback and Stress Test: Replay traffic and run stress tests to determine if your instance requires scaling to handle peak business traffic. For more information, see Traffic playback and stress testing.

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.