Options to monitor transactions
As a Hive administrator, you can view the list of all currently open and aborted
transactions using the SHOW TRANSACTIONS
statement or by querying the
TRANSACTIONS
view within the SYS
database.
The query statements display the following details about transactions:
TXN_ID
: Unique internal transaction IDSTATE
: Transaction stateSTARTED
: Timestamp when the transaction was startedLAST_HEARTBEAT
: Timestamp of the latest heartbeatUSER
: Hive user who initiated the transactionHOST
: Host machine or virtual machine where the transaction was initiatedHEARTBEAT_COUNT
: Total number of heartbeatsTYPE
: Transaction type- DEFAULT
- REPL_CREATED
- READ_ONLY
- COMPACTION
TC_DATABASE
: Hive database nameTC_TABLE
: Table nameTC_PARTITION
: Partition name (if the table is partitioned)TC_OPERATION_TYPE
:- SELECT
- INSERT
- UPDATE
- COMPACT
TC_WRITEID
: Unique internal write ID
The following sections describe the various options that you can use to monitor transactions.
SHOW TRANSACTIONS
You can run the SHOW TRANSACTIONS
statement to view details about all open
and aborted transactions.
SHOW TRANSACTIONS;
This statement lists all the transactions and you cannot filter or limit the results as required. Alternatively, you can use the SYS database to query and filter specific transactions.
Querying the SYS database
You can query the TRANSACTIONS view within the SYS
database to filter and
view specific transactions.
SELECT *
FROM SYS.TRANSACTIONS
WHERE STATE='aborted';