交易系统表说明

描述

事务是生成的伪表,以显示当前在域中运行的每个事务引擎(TE)的数据库中运行的所有事务的联合。运行交易的TE将具有有关该事务的最完整的信息。

每个交易将在此伪表中多次显示,一次用于在域中运行的每个TE。例如,如果有四个TES,则每个事务在此表中显示四次,并且每一行表示来自四个TES中的每一个交易的视图。这是预期的行为。有关每个TE的最新信息,请使用LocalTransactions表。有关所有事务的概述,请使用事务表。

The Sourcenode. column in this table specifies the TE from where this transaction is being reported, but not necessarily the TE where the transaction is executing.

The nodeid. column in this table specifies the TE on which this transaction is currently running. nodeid. for transactions with state Failed can be ignored as a special reserved nodeid. will be displayed.

Client applications should never contain code that accesses SYSTEM pseudo tables as they are subject to, and furthermore likely to, change from release to release.

领域

场地 类型 描述

ID

big

交易的唯一标识符。

状态

细绳

Active, Committed, RolledBack, Failed, or Purgatory.

nodeid.

整数

此事务运行的TE的ID。

被覆盖的

big

阻止此事务的事务的ID。

startevent.

big

开始此交易的内部事件ID。

endevent.

big

结束此交易的内部事件ID。

顺序

big

仅限内部使用。

isolationlevel.

细绳

指定连接的事务隔离级别。

  • READ COMMITTED

  • REPEATABLE READ

  • CONSISTENT READ

  • SERIALIZABLE

支持的交易隔离级别 想要查询更多的信息。

iSupdate.

布尔基

如果此事务中有更新事件,则为true。

DeadlockVictim.

布尔基

如果这笔交易是僵局的受害者,则为真实,因此丧生。

承诺服务

细绳

The commit protocol being used by the transaction. Provided in the same format as used by values of the commit database option.

队列

细绳

此交易的内部队列的名称。

Sourcenode.

整数

The node ID from which this particular row in the table has originated. If there are multiple TEs running in the domain, a row is generated in this table for each transaction for each TE. The Sourcenode. will identify the TE reporting on this transaction. See nodeid. for identifying the actual TE where this transaction is running.

xid.

字节

X /打开XA事务标识符XID结构。由全局事务格式ID,全局事务ID和分支限定符组成。有关Nuodb XA的更多详细信息,请参阅 使用NOODB的JDBC和XA事务.

perrapledby.

big

选择在当前交易之前阻止当前事务的事务的ID作为解决事务死锁的受害者。

索引

没有任何

例子

Shown below are what views of the TRANSACTIONS table would look like with two transactions running on a database with two TEs. The two TEs are running with nodeid. 3 and nodeid. 4. The transaction with ID 677653763 is running on the same TE to which the session running these select statements is connected. This can be verified by the function GETNODEID() (see SQL系统信息功能) which will return the value 3. The transaction with ID 677865476 is running on TE with nodeid. 4, the second TE.

The first example shows the view of these two running transactions from both TEs. The first two rows are the view of these transactions originating from the TE to which this session is currently connected, nodeid. 3. This is indicated by the value of the Sourcenode. column which is 3. The last two rows show the view of these same two transactions (note the IDs) from the second TE, SOURENODE equal 4. The fifth row shows a transaction that has been XA prepared by an external resource manager. Transactions that have been involved in X/Open XA have their corresponding XID populated. This ID was generated by the transaction manager when the transaction branch was started.

第二个示例仅显示在当前正在连接的TE上运行的事务,并且只有来自此TE的这些事务的视图。目前在数据库上运行的其他事务,但它们正在其他TE上运行。

第三个例子显示了从当前连接的TE的视点上运行的所有事务。第二个事务在不同的TE上运行。有关此事务的信息可能与此信息的来源源自此事务运行的TE源自何种信息。

第四个示例显示了从数据库上运行的所有事务从其运行的TE的视图。这是当前在所有TES上运行的所有事务的信息最完整的信息。

We use 放 OUTPUT VERTICAL to make the output more readable.
选择 * FROM system.transactions;
==================================== Row #1 ====================================ID : 677653763
STATE: Active
NODEID: 3
BLOCKEDBY: -1
STARTEVENT: 24368
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 0
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 3
XID: <null>
PRIORBLOCKEDBY: -1
==================================== Row #2 ====================================ID : 677865476
STATE: Active
NODEID: 4
BLOCKEDBY: -1
STARTEVENT: 29862
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 1
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 3
XID: <null>
PRIORBLOCKEDBY: -1
==================================== Row #3 ====================================ID : 677653763
STATE: Active
NODEID: 3
BLOCKEDBY: -1
STARTEVENT: 24324
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 1
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 4
XID: <null>
PRIORBLOCKEDBY: -1
==================================== Row #4 ====================================ID : 677865476
STATE: Active
NODEID: 4
BLOCKEDBY: -1
STARTEVENT: 29810
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 1
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 4
XID: <null>
PRIORBLOCKEDBY: -1
==================================== Row #5 ====================================ID : 2434
STATE: XaPrepared
NODEID: 2
BLOCKEDBY: -1
STARTEVENT: 27
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: TRUE
DEADLOCKVICTIM: FALSE
COMMITPROTOCOL: safe
QUEUE: Active
SOURCENODE: 2
XID: 0C0000000600000002000000000102030405060708090A0B0C0D0E0F1011121314010000666
    F6F626172000000000000
PRIORBLOCKEDBY: -1
SELECT * FROM system.transactions
WHERE sourcenode=getnodeid();
==================================== Row #1 ====================================ID : 677653763
STATE: Active
NODEID: 3
BLOCKEDBY: -1
STARTEVENT: 24368
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 0
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 3
XID: <null>
PRIORBLOCKEDBY: -1
==================================== Row #1 ====================================ID : 677653763
STATE: Active
NODEID: 3
BLOCKEDBY: -1
STARTEVENT: 24368
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 0
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 3
XID: <null>
PRIORBLOCKEDBY: -1
==================================== Row #2 ====================================ID : 677865476
STATE: Active
NODEID: 4
BLOCKEDBY: -1
STARTEVENT: 29862
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 1
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 3
XID: <null>
PRIORBLOCKEDBY: -1
SELECT * FROM system.transactions
WHERE sourcenode=nodeid;
==================================== Row #1 ====================================ID : 677653763
STATE: Active
NODEID: 3
BLOCKEDBY: -1
STARTEVENT: 24368
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 0
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 3
XID: <null>
PRIORBLOCKEDBY: -1
==================================== Row #2 ====================================ID : 677865476
STATE: Active
NODEID: 4
BLOCKEDBY: -1
STARTEVENT: 29810
ENDEVENT: <null>
SEQUENCE: -1
ISOLATIONLEVEL: SERIALIZABLE
ISUPDATE: 1
DEADLOCKVICTIM: 0
COMMITPROTOCOL: remote:1
QUEUE: Active
SOURCENODE: 4
XID: <null>
PRIORBLOCKEDBY: -1