Purpose
The GV$OB_TRANSACTION_PARTICIPANTS view displays information about participants of active transactions on all OBServer nodes.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | No | The ID of the tenant. |
| SVR_IP | varchar(46) | No | The IP address of the server. |
| SVR_PORT | bigint(20) | No | The port number of the server. |
| SESSION_ID | bigint(20) | No | The ID of the session. |
| SCHEDULER_ADDR | varchar(64) | No | The address of the OBServer node to which the scheduler belongs. |
| TX_TYPE | varchar(11) | No | The transaction type. Valid values:
|
| TX_ID | bigint(20) | No | The ID of the transaction. |
| LS_ID | bigint(20) | No | The ID of the log stream. |
| PARTICIPANTS | varchar(1024) | No | The list of participants. |
| CTX_CREATE_TIME | timestamp(6) | Yes | The point in time when the context was created. |
| TX_EXPIRED_TIME | timestamp(6) | Yes | The point in time when the transaction times out. |
| STATE | varchar(13) | No | The commit status of the context. |
| ACTION | varchar(10) | No | The action that was performed by the previous transaction. Valid values:
|
| PENDING_LOG_SIZE | bigint(20) | No | The size of logs that have not been flushed to the disk by the participant in the current transaction. |
| FLUSHED_LOG_SIZE | bigint(20) | No | The size of logs that have been flushed to the disk by the participant in the current transaction. |
| ROLE | varchar(8) | No | The role of the replica. Valid values: 0 and 1. The value 0 indicates a leader, and the value 1 indicates a follower. |
| COORD | bigint(20) | No | The IS ID of the coordinator. This column takes effect only in the commit phase. |
| LAST_REQUEST_TIME | timestamp(6) | Yes | The point in time when an external request is last received. |
| FORMATID | bigint(20) | No | The format type of the transaction branch identifier (XID). |
| GLOBALID | varchar(257) | No | The global identifier of the eXtended Architecture (XA) transaction. |
| BRANCHID | varchar(257) | No | The branch qualifier of the XA transaction. |
Common SQL statements
The GV$OB_TRANSACTION_PARTICIPANTS view displays the statistics on all active transactions in a cluster. A transaction involves write operations of N log streams, and each log stream generates a record. You can query this view for time-consuming transactions.
Query the GV$OB_TRANSACTION_PARTICIPANTS view for participants of active transactions that take more than 100s. The syntax is as follows:
obclient> SELECT svr_ip, tx_id, ls_id from GV$OB_TRANSACTION_PARTICIPANTS where tenant_id = xxx and ctx_create_time < date_sub(now(), INTERVAL 100 SECOND);
You can query the GV$OB_SQL_AUDIT view based on the tx_id column for all SQL statements in the transaction and their time consumption information.