All Products
Search
Document Center

ApsaraDB RDS:Use the SQL Explorer and Audit feature

Last Updated:Nov 16, 2023

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 and security audit capabilities and is integrated with the search feature and the SQL Explorer feature. You can query information about SQL statements and use the information to troubleshoot various performance issues.

Supported RDS editions and regions

RDS edition

Region

RDS High-availability Edition and RDS Cluster Edition

Note

The feature is not supported for RDS instances that run SQL Server 2008 R2 on RDS High-availability Edition.

China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Shenzhen), China (Zhangjiakou), China (Hohhot), China (Chengdu), China (Guangzhou), China (Heyuan), China (Ulanqab), China (Hong Kong), Singapore, Malaysia (Kuala Lumpur), and Indonesia (Jakarta)

Billing rules

For more information, see Billing rules.

Note

After the SQL Explorer and Audit feature is enabled, the system stops billing for the SQL Audit feature. The fees that you must pay for the SQL Explorer and Audit feature are billed to DAS Professional Edition. For more information, see Use the SQL Audit feature on an ApsaraDB RDS for SQL Server instance.

Description

  • Search: queries and exports the SQL statements that are executed and the information about the SQL statements. The information includes the database, status, and execution duration of each SQL statement.

  • SQL Explorer: diagnoses the health statuses of SQL statements, troubleshoots performance issues, and analyzes business traffic.

Enable the SQL Explorer and Audit feature

  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. If the SQL Explorer and Audit feature is disabled, click Enable. In the dialog box that appears, click Enable Professional Edition.

    If you do not purchase DAS Professional Edition by using your Alibaba Cloud account, follow the instructions to purchase DAS Professional Edition. For more information, see Purchase DAS Professional Edition.

    Note

    If the page that appears contains the Search and SQL Explorer tabs, the SQL Explorer and Audit feature is enabled.

Use the SQL Explorer and Audit feature

  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 to use the feature based on your business requirements:

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

    • 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 the SQL Explorer and Audit feature, 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 the SQL Explorer and Audit feature.

  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.

    Note
    • The default storage duration of data generated by the SQL Explorer and Audit feature is 30 days. The SQL audit logs that are stored for a period longer than the specified storage duration are deleted.

    • The storage that is occupied by the data generated by the SQL Explorer and Audit feature is provided by DAS and does not consume the storage of your database instance.

Disable the SQL Explorer and Audit feature

Warning

After you disable the SQL Explorer and Audit feature, all logs that are generated by the 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 feature are recorded from the point in time at which the SQL Explorer and Audit feature is enabled again.

  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. 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, click View Exported Logs to download the log file that you exported to your computer.

  6. In the Service Settings panel, turn off SQL Explorer and Audit, select After you disable SQL Explorer, all relevant data is deleted., and then click Disable the service.