All Products
Search
Document Center

ApsaraDB RDS:Use the SQL Explorer and Audit feature

Last Updated:Jul 18, 2024

Database Autonomy Service (DAS) provides the SQL Explorer and Audit feature for ApsaraDB RDS for SQL Server. The SQL Explorer and Audit feature is developed based on the full request analysis feature and is integrated with the search and SQL Explorer features. You can query information about SQL statements and use the information to troubleshoot various performance issues. This topic describes how to use the SQL Explorer and Audit feature.

Supported databases and regions

You must enable DAS Enterprise Edition for your database instance before you can use the SQL Explorer and Audit feature. Different versions of DAS Enterprise Edition support different databases and regions. For more information, see the Supported databases and regions section of the "Editions and supported features" topic.

Limits

The feature is not supported for serverless RDS instances. For more information, see Overview of serverless ApsaraDB RDS for SQL Server instances.

Billing

You must enable DAS Enterprise Edition for your database instance before you can use the SQL Explorer and Audit feature. For more information about the billing of DAS Enterprise Edition of different versions, see Billing overview.

Enable the SQL Explorer and Audit feature

Note

You can enable only the latest version of the SQL Explorer and Audit feature for your RDS instance.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane of the page that appears, choose Autonomy Services > SQL Explorer and Audit.

  3. Click Enable Enterprise Edition V3.

  4. Select the features that you want to enable and click Submit.

Use the SQL Explorer and Audit feature

  1. Log on to the DAS console.

  2. In the left-side navigation pane, click Instance Monitoring.

  3. On the page that appears, find the database instance that you want to manage and click the instance ID. The instance details page appears.

  4. In the left-side navigation pane, choose Autonomy Services > SQL Explorer and Audit to use the features.

    • Audit: queries and exports SQL statements and the related information, such as the database, status, and execution time. For more information, see Search (Audit).

    • SQL Explorer: performs health diagnostics, performance troubleshooting, and traffic analysis on SQL statements. For more information, see SQL Explorer.

Modify the storage duration of data generated by the SQL Explorer and Audit feature

Warning

After you reduce the storage duration of the data that is generated by SQL Explorer and Audit, DAS immediately deletes the SQL audit logs that are retained for a longer period of time than the storage duration. We recommend that you export and save SQL audit logs to your computer and then reduce the storage duration of the data that is generated by SQL Explorer and Audit.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane of the page that appears, choose Autonomy Services > SQL Explorer and Audit.

  3. Click Service Settings.

  4. In the Service Settings dialog box, modify the storage duration and click OK.

    If you have enabled DAS Enterprise Edition V3, you can modify the storage duration for different sub-features.

    Note
    • You can view the size of logs that are generated by the SQL Explorer and Audit feature to the right of the Service Settings button. You can also view the size of logs that are generated by the SQL Explorer and Audit feature in the Usage Statistics section of the Basic Information page.

    • You can use the search feature to query and export the logs that are generated by the SQL Explorer and Audit feature. For more information, see Search.

Disable the SQL Explorer and Audit feature

Warning

After you disable the SQL Explorer and Audit feature, all logs that are generated by the SQL Explorer and Audit feature are deleted. We recommend that you export and save the logs that are generated by the SQL Explorer and Audit feature to your computer and then disable the SQL Explorer and Audit feature. If you enable the SQL Explorer and Audit feature again, logs that are generated by the SQL Explorer and Audit feature are recorded from the point in time at which the SQL Explorer and Audit feature is enabled.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, choose Autonomy Services > SQL Explorer and Audit.

  3. In the Logs section of the Search tab, click Export.

  4. In the dialog box that appears, configure the Exported Fields and Export Time Range parameters, and click OK.

  5. After the logs are exported, download the log file and save it to your computer.

    The methods for downloading SQL audit logs vary based on the versions of DAS Enterprise Edition. You can download the SQL audit logs based on the actual situation in the ApsaraDB RDS console.

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

    • On the Task list tab, click Download to download the exported log file.

  6. In the Service Settings dialog box, turn off SQL insight and audit.

    If you have enabled DAS Enterprise Edition V3, clear all sub-features of the SQL Explorer and Audit feature.

    Note

    If you enable the audit log collection feature for your RDS instance in the CloudLens for RDS application of Log Service, the SQL Explorer and Audit feature is automatically enabled for the RDS instance. Therefore, you must also disable the audit log collection feature for the RDS instance. For more information, see CloudLens for RDS.

FAQ

Why does the entry point to SQL Audit disappear in the ApsaraDB RDS console?

The SQL Explorer and Audit feature is updated. The entry point changes to SQL Explorer and Audit.

Can I enable the original SQL Audit feature?

No, you can enable only the latest version of the SQL Explorer and Audit feature. For more information, see Editions and supported features.