1-- UNDOTBS usage per User:
2SELECT u.TABLESPACE_NAME AS TABLESPACE,
3 s.USERNAME,
4 u.STATUS,
5 sum(u.BYTES) / 1024 / 1024 AS SUM_IN_MB,
6 count(u.SEGMENT_NAME) AS SEG_CNTS
7FROM DBA_UNDO_EXTENTS u, V$TRANSACTION T, V$SESSION s
8WHERE T.ADDR = s.TADDR
9GROUP BY u.TABLESPACE_NAME, s.USERNAME, u.STATUS
10ORDER BY 1, 2, 3;