-- tmp.sql: TEMP tablespace size, allocation and free space -- Copyright (c) HASHJOIN. MIT License (https://hashjoin.com/kb/license/) -- https://hashjoin.com/kb/oracle/temp-tablespace-usage/ -- -- Usage: @tmp.sql clear col ttit off btit off set lines 132 set head on col file_name format a45 col tablespace_name format a10 col mbytes format 999,999,999 select tablespace_name,file_id,file_name,bytes/1024/1024 mbytes from dba_temp_files ; select * from v$temp_extent_pool; select * from v$temp_space_header; col tot_mb format 999,999,999 col alloc_mb format 999,999,999 col free_mb format 999,999,999 SELECT TABLESPACE_NAME , TABLESPACE_SIZE/1024/1024 tot_mb , ALLOCATED_SPACE/1024/1024 alloc_mb , FREE_SPACE/1024/1024 free_mb FROM dba_temp_free_space; set echo on /* To get some space back: ALTER TABLESPACE temp SHRINK SPACE; ALTER TABLESPACE temp SHRINK SPACE KEEP 40M; */