- SET linesize 150
- column tablespace_name format a20 heading 'Tablespace'
- column sumb format 999,999,999
- column extents format 9999
- column bytes format 999,999,999,999
- column largest format 999,999,999,999
- column Tot_Size format 999,999 Heading 'Total| Size(Mb)'
- column Tot_Free format 999,999,999 heading 'Total Free(MB)'
- column Pct_Free format 999.99 heading '% Free'
- column Chunks_Free format 9999 heading 'No Of Ext.'
- column Max_Free format 999,999,999 heading 'Max Free(Kb)'
- SET echo OFF
- PROMPT FREE SPACE AVAILABLE IN TABLESPACES
- SELECT a.tablespace_name ,
- SUM(a.tots /1048576) Tot_Size,
- SUM(a.sumb /1048576) Tot_Free,
- SUM(a.sumb) *100/SUM(a.tots) Percent_Free,
- SUM(a.largest/1024) Max_Free,
- SUM(a.chunks) Chunks_Free
- FROM ( SELECT tablespace_name,
- 0 tots ,
- SUM(bytes) sumb ,
- MAX(bytes) largest ,
- COUNT(*) chunks
- FROM dba_free_space a
- GROUP BY tablespace_name
- UNION
- SELECT tablespace_name,
- SUM(bytes) tots,
- 0,0,0
- FROM dba_data_files
- GROUP BY tablespace_name
- )
- a
- GROUP BY a.tablespace_name
- ORDER BY pct_free;