view_tran.sql


-- Display active transactions in RBS's and current statement.

set linesize 80
set verify off message off echo off pause off timing off time off
set feedback off
column o format a8 heading 'O/S|User'
column u format a10 heading 'Oracle|Userid'
column s format a12 heading 'R-S|Name'
column txt format a45 heading 'Current Statement' word

spool monrbs
select osuser o,
       username u,
       segment_name s,
       sa.sql_text txt
from   v$session s,
       v$transaction t,
       dba_rollback_segs r,
       v$sqlarea sa
where  s.taddr = t.addr
and    t.xidusn = r.segment_id(+)
and    s.sql_address = sa.address(+)
/

spool off
set verify on
set message on
set pause on
column o clear
column u clear
column txt clear