oracle 檢視分散式事物

hurp_oracle發表於2014-12-24

Solving locking problems in a XA environment (文件 ID 1248848.1)
connect / as sysdba

set pagesize 1000
prompt +++ In memory transaction +++ 
select /*+ ORDERED */
'----------------------------------------'||'
Curent Time : '|| substr(to_char(sysdate,' HH24.MI.SS'),1,22) ||'
'||'TX start_time: '||t.KTCXBSTM||'
'||'FORMATID: '||g.K2GTIFMT ||'
'||'GTXID: '||g.K2GTITID_EXT ||'
'||'Branch: '||g.K2GTIBID ||'
Local_Tran_Id ='||substr(t.KXIDUSN||'.'||t.kXIDSLT||'.'||t.kXIDSQN,1,15)||'
'||'KTUXESTA='|| x.KTUXESTA ||'
'||'KTUXEDFL='|| x.KTUXECFL ||'
Lock_Info: ID1: ' || ((t.kXIDUSN*64*1024)+ t.kXIDSLT)
||' ID2: '|| t.kXIDSQN
XA_transaction_INFO 
from x$k2gte g, x$ktcxb t, x$ktuxe x
where g.K2GTDXCB =t.ktcxbxba and
x.KTUXEUSN = t.KXIDUSN(+) and
x.KTUXESLT = t.kXIDSLT(+) and
x.KTUXESQN =t.kXIDSQN(+);

prompt +++ Timed out, prepared XA transactions +++ 
select global_tran_fmt, global_foreign_id, branch_id,state, 
tran.local_tran_id 
from sys.pending_trans$ tran, sys.pending_sessions$ sess
where tran.local_tran_id = sess.local_tran_id
and tran.state = 'prepared'
and dbms_utility.is_bit_set(tran.session_vector, sess.session_id)=1;


How to identify a session started by a remote distributed transaction? (文件 ID 332326.1)

The following query can be used to identify the session started by a distributed transaction
select username, osuser, status, sid, serial#, machine, process, terminal, program 
from v$sessionwhere saddr in (select k2gtdses from sys.x$k2gte );


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29446986/viewspace-1379029/,如需轉載,請註明出處,否則將追究法律責任。

相關文章