Data Management (DMS) provides the operation audit feature in addition to the basic features of operations log management. You can use this feature to troubleshoot database issues with ease and audit the operations that are performed on databases. You can also use this feature to view and manage the SQL statements that are used in the SQLConsole, tickets, logon information, and operations logs.

Features

The following table describes the two modules of the operation audit feature in DMS: Operation Logs and Operation audit.
Module Description Item
Operation Logs Displays the logs of all the operations that are performed in DMS. Includes the logs of management and configuration operations, SQL statements that are used in the SQLConsole, tickets, and logon information.
Operation audit Displays all the operations that are performed on databases in DMS.
Note This module provides a user interface (UI) for you to audit operations in a centralized manner. This also helps you troubleshoot database issues with ease.
Includes SQL statements that are used in the SQLConsole, tickets, and logon information.
Log data is permanently retained in DMS. You can access and view the log data of the instances that are managed in Stable Change or Security Collaboration mode at any time.
Note You can view the log data of the instances that are managed in Flexible Management mode only for the last seven days. To view all log data, upgrade the control mode of the instances. For more information, see Service specification upgrade.

How to use and who can use the operation audit feature

The following table describes the roles that you can assume to use the operation audit feature. It also shows you how to go to the Operation audit tab in the DMS console.
Auditing dimension Entry to operation audit Supported role
Database

You can view and audit only the operations that are performed on the current database.

  • On the SQLConsole tab of the database that you want to audit, click the Operation audit icon icon in the upper-right corner.
  • In the left-side navigation pane of the DMS console, click the instance where the database you want to audit resides, right-click the database, and then choose Audit > Operation audit.
You can be a DMS administrator, a security administrator, a database administrator (DBA), an instance owner, or a regular user.
Note If you are a regular user, you can view and audit only the operations that you performed on the current database.
Instance

You can view and audit only the operations that are performed on the current instance.

In the left-side navigation pane of the DMS console, right-click the instance that you want to audit and choose Audit > Operation audit. You can be a DMS administrator, a security administrator, a DBA, an instance owner, or a regular user.
Note If you are a regular user, you can view and audit only the operations that you performed on the current instance.
Global

You can view and audit all the operations that are performed in DMS.

In the top navigation bar, move the pointer over the More icon and choose System > Operation audit. You can be a DMS administrator, a security administrator, or a DBA.

View and download operation records

This example shows you how to view and download all the SQL statements that are used in the SQLConsole in the last month.

  1. Log on to the DMS console.
  2. In the top navigation bar, move the pointer over the More icon and choose System > Operation audit.
    By default, a list of SQL statements appears.
  3. Set the Time parameter to Last One Month and click Search.
    Then, DMS returns the search results.
  4. Click the Download icon icon to download the results.

    Then, DMS exports an XLSX file that contains the search results on the current page.

    Download operation records
    Note To preview and export more results, you can set the Items per page parameter to 100.

Download operations logs

You can download operations logs only by calling the GetOpLog operation. For more information, see GetOpLog.