[20231025]完善tpt的trans.sql指令碼.txt

lfree發表於2023-10-30

[20231025]完善tpt的trans.sql指令碼.txt

--//補充status2欄位,說明一些細節。

-- Copyright 2018 Tanel Poder. All rights reserved. More info at
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.

col 0xFLAG just right
col trans_username HEAD USERNAME FOR A25

select
    s.sid
  , s.serial#
  , s.username       trans_username
  , 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部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2991955/,如需轉載,請註明出處,否則將追究法律責任。

相關文章