/**************************************************************/
-- To see how much actual total tempspace is used
-- Even the sql ended, if the user session remained login, the tempspace will not be released
/**************************************************************/
SELECT
F.TABLESPACE_NAME,
G.TOTAL_TEMP_SPACE_USED,
F.TOTAL_TEMP_MB,
G.TOTAL_TEMP_SPACE_USED/F.TOTAL_TEMP_MB*100 PCT_TEMP_USED,
100 - (G.TOTAL_TEMP_SPACE_USED/F.TOTAL_TEMP_MB*100) PCT_TEMP_FREE
FROM
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024 TOTAL_TEMP_MB FROM DBA_TEMP_FILES GROUP BY TABLESPACE_NAME) F ,
(SELECT
B.TABLESPACE_NAME,
SUM(A.BLOCKS * B.BLOCK_SIZE/1024/1024 ) TOTAL_TEMP_SPACE_USED
FROM
V$SORT_USAGE A,
DBA_TABLESPACES B
WHERE
A.TABLESPACE = B.TABLESPACE_NAME
GROUP BY B.TABLESPACE_NAME) G
WHERE F.TABLESPACE_NAME = G.TABLESPACE_NAME
/
No comments:
Post a Comment