Updated on 2026-01-29 GMT+08:00

Step 5: Enable Database Audit

By default, database audit complies with a full audit rule, which is used to audit all databases that are connected to the database audit instance. You can enable audit and check audit results. For details, see Viewing Audit Data.

Prerequisites

The status of the agent is Running.

Enabling Database Audit

  1. Log in to the management console.
  2. Select a region, click , and choose Security & Compliance > Database Security Service. The Dashboard page is displayed.
  3. In the navigation tree on the left, choose Databases.
  4. Select a database audit instance from the Instance drop-down list.
  5. In the database list, click Enable in the Operation column of the database you want to audit.

    The Audit Status of the database is Enabled. You do not need to restart the database.

    Figure 1 Enabling database audit

Verifying Audit Results

  1. Run an SQL statement (for example, show databases) in the target database.
  2. Log in to the management console.
  3. Select a region, click , and choose Security & Compliance > Database Security Service. The Dashboard page is displayed.
  4. In the navigation tree on the left, choose Data Reports. The Data Reports page is displayed.
  5. In the Instance drop-down list, select the instance that audits the target database.
  6. Click the Statements tab.
  7. Expand the drop-down list and select All, 30 minutes, 1 hour, 24 hours, 7 days, 30 days, or a custom time range. Click the search box and select an attribute or enter a keyword.

    Figure 2 Viewing SQL statements

References

If the network communication between the agent and the database audit instance is normal but the audit still fails, rectify the fault by referring to Database Audit Is Running Properly But Generates No Audit Records.