The following query helps us to check the total size and free space of individual tablespaces in a tabular format
set linesize 1200
set pagesize 1200
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) Pct_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;
set pagesize 1200
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) Pct_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;
Output:
Total
Tablespace Size(Mb) Total Free(MB) % Free Max Free(Kb) No Of Ext.
-------------------- --------- -------------- ------- ------------ ----------
XXTA 194,168 5,242 2.70 3,184,640 32
APPS_TS_QUEUES 52,384 1,865 3.56 1,909,760 2
APPS_TS_MEDIA 81,184 4,166 5.13 3,431,680 2
APPS_TS_SUMMARY 14,072 1,468 10.43 1,502,720 1
CTXD 16,548 2,152 13.00 2,033,920 3
SYSTEM 10,000 1,817 18.17 345,520 91
APPS_TS_ARCHIVE 11,822 2,232 18.88 2,032,384 2
APPS_TS_SEED 3,524 1,067 30.29 911,744 2
APPS_TS_INTERFACE 12,024 3,713 30.88 359,680 #####
SYSAUX 8,000 2,619 32.74 1,019,840 118
APPS_TS_NOLOGGING 14,800 5,762 38.93 491,776 44
APPS_TS_TX_IDX 385,142 153,750 39.92 1,408 #####
APPS_TS_TX_DATA 454,652 181,574 39.94 315,008 #####
TBS16KDATA 2,000 1,592 79.60 1,630,144 1
APPS_UNDOTS1 119,388 98,042 82.12 3,381,248 1807
DICOVERER 2,000 1,842 92.08 1,885,504 4
OLAP 500 469 93.78 480,128 1
ODM 500 486 97.10 497,152 1
PORTAL 100 99 98.63 100,992 1
OWAPUB 50 50 99.75 51,072 1
XXVTS 1,000 998 99.81 1,022,016 1
APPS_TS_TOOLS 500 500 99.99 511,936 1
22 rows selected.
Tablespace Size(Mb) Total Free(MB) % Free Max Free(Kb) No Of Ext.
-------------------- --------- -------------- ------- ------------ ----------
XXTA 194,168 5,242 2.70 3,184,640 32
APPS_TS_QUEUES 52,384 1,865 3.56 1,909,760 2
APPS_TS_MEDIA 81,184 4,166 5.13 3,431,680 2
APPS_TS_SUMMARY 14,072 1,468 10.43 1,502,720 1
CTXD 16,548 2,152 13.00 2,033,920 3
SYSTEM 10,000 1,817 18.17 345,520 91
APPS_TS_ARCHIVE 11,822 2,232 18.88 2,032,384 2
APPS_TS_SEED 3,524 1,067 30.29 911,744 2
APPS_TS_INTERFACE 12,024 3,713 30.88 359,680 #####
SYSAUX 8,000 2,619 32.74 1,019,840 118
APPS_TS_NOLOGGING 14,800 5,762 38.93 491,776 44
APPS_TS_TX_IDX 385,142 153,750 39.92 1,408 #####
APPS_TS_TX_DATA 454,652 181,574 39.94 315,008 #####
TBS16KDATA 2,000 1,592 79.60 1,630,144 1
APPS_UNDOTS1 119,388 98,042 82.12 3,381,248 1807
DICOVERER 2,000 1,842 92.08 1,885,504 4
OLAP 500 469 93.78 480,128 1
ODM 500 486 97.10 497,152 1
PORTAL 100 99 98.63 100,992 1
OWAPUB 50 50 99.75 51,072 1
XXVTS 1,000 998 99.81 1,022,016 1
APPS_TS_TOOLS 500 500 99.99 511,936 1
22 rows selected.