[20241127]建立完善trans.sql脚本.txt
--//增加program字段,确定是什么程序产生的事务.
$ cat tpt/trans.sql
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
col 0xFLAG just right
col trans_username HEAD USERNAME FOR A10
col program format a16
col status format a10
col xid format a16
select
s.sid
, s.serial#
, s.username trans_username
, upper(s.program) program
, t.addr taddr
, s.saddr ses_addr
, t.used_ublk
, t.used_urec
-- , t.start_time
, to_char(t.flag, 'XXXXXXXX') "0xFLAG"
, t.status||CASE WHEN BITAND(t.flag,128) = 128 THEN ' ROLLING BACK' END status
, decode(t.space, 'YES', 'SPACE TX', decode(t.recursive, 'YES', 'RECURSIVE TX', decode(t.noundo, 'YES', 'NO UNDO TX', t.status) )) status2
, t.start_date
, XIDUSN
, XIDSLOT
, XIDSQN
, t.xid
, t.prv_xid
, t.ptx_xid
from
v$session s
, v$transaction t
where
s.saddr = t.ses_addr
/
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-3051407/ ,如需转载,请注明出处,否则将追究法律责任。