查看oracle undo segment段的信息:
SELECT T1.USN, T2.NAME, T1.STATUS, T1.LATCH, T1.EXTENTS, T1.WRAPS, T1.EXTENDS FROM V$ROLLSTAT T1, V$ROLLNAME T2 WHERE T1.USN = T2.USN;
检查事务使用undo segment的情况:
SELECT s.username, s.sid, pr.PID, s.OSUSER, s.MACHINE, s.PROGRAM, rs.segment_id, r.usn, rs.segment_name, r.rssize/1024/1024, sq.sql_text FROM gv$transaction t, gv$session s, gv$rollstat r, dba_rollback_segs rs ,gv$sqltext sq,gv$process pr WHERE s.saddr = t.ses_addr AND t.xidusn = r.usn AND rs.segment_id = t.xidusn AND s.sql_address=sq.address AND s.sql_hash_value = sq.hash_value AND s.PADDR=pr.ADDR ORDER BY t.used_ublk DESC ,sq.PIECE;
时间: 2024-12-27 08:11:30