You are on page 1of 1

--If the wor area_size_policy parameter is set to AUTO, --then the pga_aggregate_target parameter indicates how much memory

can be used collectively by all sessions for activities such as sorting and hashing. --Monitoring Temporary Space Usage

A.tablespace_name tablespace, D.mb_total, SUM (A.used_bloc s * D.bloc _size) / 1024 / 1024 mb_used, D.mb_total - SUM (A.used_bloc s * D.bloc _size) / 1024 / 1024 mb_free FROM v$sort_segment A, ( SELECT B.name, C.bloc _size, SUM (C.bytes) / 1024 / 1024 mb_total FROM v$tablespace B, v$tempfile C WHERE B.ts#= C.ts# GROUP BY B.name, C.bloc _size ) D WHERE A.tablespace_name = D.name GROUP by A.tablespace_name, D.mb_total; --Sort Space Usage by Session SELECT odule, lespace, FROM WHERE AND AND GROUP BY S.sid || ',' || S.serial# sid_serial, S.username, S.osuser, P.spid, S.m S.program, SUM (T.bloc s) * TBS.bloc _size / 1024 / 1024 mb_used, T.tab COUNT(*) sort_ops v$sort_usage T, v$session S, dba_tablespaces TBS, v$process P T.session_addr = S.saddr S.paddr = P.addr T.tablespace = TBS.tablespace_name S.sid, S.serial#, S.username, S.osuser, P.spid, S.module, S.program, TBS.bloc _size, T.tablespace ORDER BY sid_serial; --Sort Space Usage by Statement SELECT S.sid || ',' || S.serial# sid_serial, S.username, T.bloc s * TBS.bloc _size / 1024 / 1024 mb_used, T.tablespace, T.sqladdr address, Q.hash_value, Q.sql_text FROM v$sort_usage T, v$session S, v$sqlarea Q, dba_tablespaces TBS WHERE T.session_addr = S.saddr AND T.sqladdr = Q.address (+) AND T.tablespace = TBS.tablespace_name ORDER BY S.sid;

SELECT

You might also like