Updated on 2022-12-30 GMT+08:00

Viewing SQL Statement Details

After connecting the database to the database audit instance, view SQL statements of the database.

Prerequisites

  • You have purchased a database audit instance and the Status is Running.
  • Database audit has been enabled.
  • A security group rule has been configured for the database audit instance.

Procedure

  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 Instance drop-down list, select the instance whose SQL statement information you want to view.
  4. Click the Statements tab.
  5. Query SQL statement information, as shown in Figure 1.

    Figure 1 Querying SQL statements

    To query a specified SQL statement, perform the following steps:

    • Select Last 30 minutes, 1 hour, 24 hours, 7 days, or 30 days, or click to set start time and end time, and click Search to view SQL statements of the specified time range.
    • Select All, High, Moderate, Low, or Trusted for Risk Severity and click Search. SQL statements of specified severity are displayed in the list.
    • Click next to Advanced Settings, enter the information, and click Search, as shown in Figure 2. The specified SQL statements are displayed in the list.

      A maximum of 10,000 records can be retrieved in a query.

      Figure 2 Advanced settings

  6. In the row containing the desired SQL statement, click Details in the Operation column. See Figure 3.

    Figure 3 Viewing details of SQL statements

  7. View the SQL statement information in the Details dialog box, as shown in Figure 4. For details about related parameters, see Table 1.

    The maximum length of an audit statement or result set is 10,240 bytes. Excessive parts are not recorded in audit logs.

    Figure 4 Details dialog box
    Table 1 Parameters for details of SQL statements

    Parameter

    Description

    Session ID

    ID of an SQL statement, which is automatically generated

    Database Instance

    Database where an SQL statement is executed

    Database Type

    Type of the database where an SQL statement is executed

    Database User

    Database user for executing an SQL statement

    Client MAC Address

    MAC address of the client where an SQL statement is executed

    Database MAC Address

    MAC address of the database where an SQL statement is executed

    Client IP Address

    IP address of the client where an SQL statement is executed

    Database IP Address

    IP address of the database where an SQL statement is executed

    Client Port

    Port of the client where an SQL statement is executed

    Database Port

    Port of the database where the SQL statement is executed

    Client Name

    Name of the client where an SQL statement is executed

    Operation Type

    Type of an SQL statement operation

    Operation Object Type

    Type of an SQL statement operation object

    Response Result

    Response by executing an SQL statement

    Affected Rows

    Number of rows affected by executing an SQL statement

    Started

    Time when an SQL statement starts to be executed

    Ended

    Time when the SQL statement execution ends

    SQL Statement

    Name of an SQL statement

    Request Result

    Result of requesting for executing an SQL statement

Helpful Links