Temp space info
********************
SELECT A.tablespace_name tablespace, D.mb_total,
SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
FROM v$sort_segment A,
(
SELECT B.name, C.block_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.block_size
) D
WHERE A.tablespace_name = D.name
GROUP by A.tablespace_name, D.mb_total
Who is using Temp
***********************
SELECT b.TABLESPACE
, b.segfile#
, b.segblk#
, ROUND ( ( ( b.blocks * p.VALUE ) / 1024 / 1024 ), 2 ) size_mb
, a.SID
, a.serial#
, a.username
, a.osuser
, a.program
,a.machine
,a.sql_id
,a.prev_sql_id
, a.status
from v$session a , v$sort_usage b, v$process c, v$parameter p
where p.name= 'db_block_size' and a.saddr = b.session_addr
and a.paddr = c.addr
order by b.tablespace, 4 desc, b.segfile#, b.segblk#, b.blocks;
**********
No comments:
Post a Comment