>>Script Language and Platform: Oracle
Each transaction will be put in the v$transaction table. This query will give you which rollback segment they are using and how much. It will also show how much temp space they are using. If the column STATUS shows up "ACT" the statement is currently running, if it shows up "INA" then the statment has stopped and it has not committed or rolled back.
Author: Shawn Ellinger
column userid format 9999 Heading SID column st format a14 heading "Start Time" column ts format a8 heading " Tran| Status" column ss format a3 Just Right heading "Sess|Stat" column rbs format a10 just left column blocks format 999999 column used_urec format 999999 heading "Undo|Records" column used_ublk format 999999 heading "Undo|Blocks" column extents format 999 heading "RBS|EXT" column pct format 999 column sze format 999 heading "TEMP|(M)" set numw 8 set feedback on select s.sid userid, substr(t.start_time,1,14) st, substr(s.status,1,3) ss, t.log_io, t.phy_io, t.used_urec, t.used_ublk, rb.segment_name RBS, rs.EXTENTS, trunc(blocks*8192/1024/1024) sze from v$sort_usage su, v$rollstat rs, sys.dba_rollback_segs rb, v$session s, v$transaction t where t.ses_addr = s.saddr and t.xidusn = rb.segment_id and t.xidusn = rs.usn and s.SADDR=su.session_addr(+) order by to_date(t.start_time, 'MM/DD/RR HH24:MI:SS') /
Disclaimer: We hope that the information on these script pages is
valuable to you. Your use of the information contained in these pages,
however, is at your sole risk. All information on these pages is provided
"as -is", without any warranty, whether express or implied, of its accuracy,
completeness, or fitness for a particular purpose...
Back to Database Journal Home