All Products
Search
Document Center

ApsaraDB RDS:SQL Explorer and Audit for ApsaraDB RDS for SQL Server

Last Updated:Mar 03, 2026

When you need to investigate slow queries, trace unauthorized access, or meet compliance requirements, manually collecting SQL execution records is impractical. SQL Explorer and Audit automatically captures all SQL statements executed by the database kernel -- including the execution account, source IP address, and execution details -- with negligible impact on instance performance.

SQL Explorer and Audit provides two capabilities:

  • Audit: Query and export execution records of historical SQL statements, including database name, execution status, and running time.

  • SQL Explorer: SQL health diagnostics, performance issue troubleshooting, and service traffic analysis.

Supported instances

Note

Custom policies can also grant a RAM user the permissions required for the audit feature, including the export function.

Billing

After you enable SQL Explorer and Audit, billing for the original SQL Audit (Database Audit) feature stops. SQL Explorer and Audit is billed as part of Database Autonomy Service (DAS) Enterprise Edition. For more information, see Billing.

Enable SQL Explorer and Audit

  1. Go to the Instances page. In the top navigation bar, select the region of your RDS instance, then click the instance ID.

  2. In the left-side navigation pane, choose Autonomy Services > SQL Explorer and Audit.

  3. Click Enable Audit Logs, select the features to enable, and click Submit.

    Enable SQL Explorer and Audit

  4. Click OK in the confirmation dialog box.

After SQL Explorer and Audit is enabled, use the Audit and SQL Explorer features on the SQL Explorer and Audit page as needed.

Change the data storage duration

Warning

Reducing the storage duration causes DAS to immediately delete audit logs that exceed the new duration. Export and save audit logs before you reduce the storage duration.

  1. Go to the Instances page. In the top navigation bar, select the region of your RDS instance, then click the instance ID.

  2. In the left-side navigation pane, choose Autonomy Services > SQL Explorer and Audit.

  3. Click Service Settings.

  4. In the Service Settings dialog, adjust the Audit Retention duration and click Submit.

Note

SQL Explorer and Audit data is stored by DAS. It does not occupy the storage space of your database instance.

Disable SQL Explorer and Audit

Warning

Disabling SQL Explorer and Audit deletes all logs. Export and save logs before you disable the feature. If you re-enable the feature later, logs are recorded only from the time of re-enabling.

Step 1: Export logs

  1. Go to the Instances page. In the top navigation bar, select the region of your RDS instance, then click the instance ID.

  2. In the left-side navigation pane, choose Autonomy Services > SQL Explorer and Audit.

  3. Click Export.

  4. Select the fields and time range for the export. If you use a hybrid of hot and cold storage, select a CSV Separator.

  5. After the export completes, click Tasks to download and save the exported file.

Step 2: Disable the feature

  1. Click Service Settings.

  2. Clear all SQL Explorer and Audit feature checkboxes and click Submit.

Important

The system releases the storage space occupied by SQL Explorer and Audit data approximately one hour after you disable the feature.

FAQ

How do I view historical SQL execution records?

If SQL Explorer and Audit is enabled, use the Audit feature to view and export SQL execution records directly.

If the feature is not enabled, historical SQL records are not available. As an alternative, restore data to a specific point in time to compare SQL changes at different points and analyze modifications.

Note

Enable SQL Explorer and Audit as early as possible to ensure continuous recording of SQL execution details for future analysis and audits.