Doc

    Name:    tspuse.sql

    This script lists tablespace disk storage information

#

ttitle 'Tablespace Storage Information'

SELECT SUBSTR(D.TABLESPACE_NAME,1,15)                    TSPACE,
       D.FILE_ID                                         FILE_ID,
       D.BYTES / 1024 / 1024                             TOT_MB,
       D.BYTES / 4096                                    ORA_BLKS,
       SUM(E.BLOCKS)                                     TOT_USED,
       ROUND(SUM(E.BLOCKS) / (D.BYTES / 4096), 4) * 100  PCT_USED
 FROM  SYS.DBA_EXTENTS   E, 
       SYS.DBA_DATA_FILES D
 WHERE D.FILE_ID = E.FILE_ID (+)
 GROUP BY D.TABLESPACE_NAME, D.FILE_ID, D.BYTES
/