Viewing SQL Statement Details
After connecting the database to the database audit instance, view SQL statements of the database.
Prerequisites
- The database audit instance is in the Running state.
- For details about how to enable database audit, see Enable Database Audit.
Procedure
- Log in to the management console.
- Select a region, click
, and choose . The Dashboard page is displayed.
- In the navigation tree on the left, choose Data Reports. The Data Reports page is displayed.
- In the Instance drop-down list, select the instance whose SQL statement information you want to view.
- Click the Statements tab.
- View SQL statement information.
Figure 1 Querying SQL statements
To query a specified SQL statement, perform the following steps:
- Select the time range ( All time, Last 30 minutes, 1 hour, Today, 7 days, or 30 days ), or customize the start time and end time. Click
, the SQL statements in the time period are displayed in the list.
- Select All, High, Moderate, Low, or No risk for Risk Level and click
. SQL statements of specified severity are displayed in the list.
A maximum of 10,000 records can be retrieved in a query.
- Select the time range ( All time, Last 30 minutes, 1 hour, Today, 7 days, or 30 days ), or customize the start time and end time. Click
- Click the SQL statement.
- View the SQL statement information in the StatementDetails dialog box. 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 2 Statement dialog boxTable 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/Domain Name
IP address or the domain name 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
- If the entered SQL statement is not displayed, the connection between the agent and the database audit instance is abnormal. Rectify the fault by following the instructions in What Do I Do If the Communication Between the Agent and Database Audit Instance Is Abnormal?
- If SSL is enabled for a database, the database cannot be audited. To use database audit, disable SSL first. For details, see How Do I Disable SSL for a Database?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot