Purpose
The GV$OB_TRANSACTION_PARTICIPANTS view displays information about participants of active transactions on all OBServer nodes.
Fields
| Field | 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 session ID. |
| SCHEDULER_ADDR | varchar(64) | NO | The IP address of the server where the transaction session runs. |
| TX_TYPE | varchar(11) | NO | The type of the transaction. |
| TX_ID | bigint(20) | NO | The transaction ID. |
| LS_ID | bigint(20) | NO | The information about a partition involved in a transaction record. |
| PARTICIPANTS | varchar(1024) | NO | All partitions involved in the transaction. |
| CTX_CREATE_TIME | timestamp(6) | YES | The time when the transaction context was created. |
| TX_EXPIRED_TIME | timestamp(6) | YES | The time when the transaction expires. |
| STATE | varchar(13) | NO | The status of the transaction. |
| ACTION | varchar(10) | NO | The action performed by the current 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. |
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 field for all SQL statements in the transaction and their time consumption information.