1.查看每个会话所占用的内存大小
SELECT server, s.username, osuser, NAME, VALUE / 1024 / 1024 MB, s.SID, s.serial#, spid FROM v$session s, v$sesstat st, v$statname sn, v$process p WHERE st.SID = s.SID AND st.statistic# = sn.statistic# AND sn.NAME LIKE 'session pga memory' AND p.addr = s.paddr ORDER BY VALUE DESC;
2.查看当前会话的游标
SELECT * FROM V$OPEN_CURSOR WHERE USER_NAME = 'LABA_TEMP'; SELECT * FROM LABAC_ACCOUNT_COUPONS; SELECT SUM(A.VALUE), B.NAME FROM V$SESSTAT A, V$STATNAME B WHERE A.STATISTIC# = B.STATISTIC# AND B.NAME = 'opened cursors current' GROUP BY B.NAME;