OceanBase Cloud Platform (OCP) allows you to view basic information and associated SQL statements of large transactions. You can use the transaction diagnostics feature to identify and analyze large transactions.
You can diagnose transactions by using one of the following methods:
Method 1: Log in to the OCP console. In the left-side navigation pane, click
OceanBase Autonomy Service . On the page that appears, find the target cluster and click its name to go to theReal-time Diagnostics page. Then, click theTransaction Diagnostics tab.Method 2: Log in to the OCP console. On the
Overview page of a tenant, clickTransaction Diagnostics in the left-side navigation pane.
Applicability
OCP Community Edition does not support OceanBase Autonomy Service. To use this service, go to the relevant page by using Method 2.
Prerequisites
To diagnose transactions by using Method 1, make sure that you have the following permissions:
-
Resource Permissions : Cluster Read-only or Tenant Read-only permission -
Menu Permissions : Permission on theReal-time Diagnostics menu ofOceanBase Autonomy Service
-
To diagnose transactions by using Method 2, make sure that you have the following permissions:
-
Resource Permissions : Cluster Read-only or Tenant Read-only permission -
Menu Permissions : Permission on theTransaction Diagnostics menu ofTenants
-
The version of OceanBase Database is V3.2.x or later so that the Log Volume of Single Participant field is available.
You have enabled parameters in the
Transaction Diagnostics Collection section by referring to Manage parameters.
Procedure
The procedure of Method 1 is described as follows:
Log in to the OCP console.
In the left-side navigation pane, click
OceanBase Autonomy Service .In the
Cluster Details section, click the name of the cluster that you want to view.On the
Transaction Diagnostics tab of theReal-time Diagnostics page, filter the transactions.By default, the system displays the transactions whose execution time is greater than 500 ms or transactions whose log volume of a single participant exceeds 0.5 MB. You can specify another execution time or log volume range to query transactions.
Turn on
Auto Refresh . The transaction list on the page will be automatically refreshed based on the refresh frequency. You can set the refresh frequency to 5s, 10s, or 30s. The default refresh frequency is 10s.

View transactions.
You can view transactions by transaction status. Transactions are divided into long-running transactions, suspended transactions, and other transactions by status. The transaction list displays information of the running large transactions. The list contains the following columns:
Transaction Hash ,Session ID ,Transaction Type ,Affected Rows ,Execution Time Elapsed , and Maximum Log Volume of Single Participant. The following table describes the columns of the transaction list.Column Description Transaction Hash The unique ID of the transaction. Session ID The unique ID of the session. For more information, see Manage the sessions of a tenant. Transaction Type The transaction type. Valid values: XA Transaction, Distributed Transaction, and Ordinary Transaction. Note
eXtended Architecture (XA) transactions are not supported in OceanBase Database V4.0 and later.Affected Rows The number of rows affected in the execution of all SQL statements in the transaction. Execution Time Elapsed (ms) The amount of time for which the transaction has been executed. 
View the details of a transaction.
Click the hash value of a specific transaction. The
Transaction Details page appears. You can view the basic information, execution information, and details of executed SQL statements of the transaction on the page.Click
Close Transaction in the upper-right corner to close the session of the transaction. Only regular transactions and distributed transactions in theLong Transactions list can be closed.Click the SQL text in the
SQL Statement with Longest Execution Time ,SQL Statement with Most Affected Rows , orDetails About Executed SQL Statements field to view the details of the SQL statement.
Close transactions.
On the
Transactions page, select the transaction to be closed and clickClose Transaction in the correspondingActions column. You can also select multiple transactions and clickBatch Close Transactions . In the dialog box that appears, clickOK to close the session of the selected one or more transactions. After the session of a transaction is closed, the transaction is rolled back and the session connection is also terminated.Notice
Only regular transactions and distributed transactions in the Long Transactions list can be closed.