Updated on 2025-04-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 the Audit Dashboard.

Prerequisites

The status of the agent is Running.

Enabling Database Audit

  1. For details about how to install agents, see Step 3.
  2. For details about how to add a security group rule, see Step 4.
  3. Log in to the management console.
  4. Click and choose Security > Database Security Service. The Dashboard page is displayed.
  5. In the navigation tree on the left, choose Databases.
  6. Select a database audit instance from the Instance drop-down list.
  7. 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. Click and choose Security > 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. Locate the row that contains the target time, click , select the start time and end time, and click Submit. In the upper part of the list, select All time, Last 30 minutes, Last hour, Today, Last week, Last month, or Custom.

    Figure 2 Viewing SQL statements