How to Show Used/Free Tablespace Space in Oracle DB

This script will list tablespace wise free space and used space (also total size) as well as total space. For running this query you must have SELECT privileges to SYS.DBA_FREE_SPACE, SYS.V_$DATAFILE, SYS.V_$TABLESPACE views.

SELECT "Tablespace Name",
       nvl(Free_space, 0) "Free Size(MB)",
       nvl(total_space-Free_space, 0) "Used Size(MB)", 
       total_space "Total Size(MB)"
  (select tablespace_name, sum(bytes/1024/1024) free_space
     from sys.dba_free_space
    group by tablespace_name
  ) Free,
  (select,  sum(bytes/1024/1024) total_space
     from sys.v_$datafile a, sys.v_$tablespace B
    where a.ts# = b.ts#
    group by
  ) Total
WHERE Free.Tablespace_name(+) =


Popular posts from this blog

How to create Oracle stored Procedures using TOAD for Oracle

How to Create Packages in Oracle Database using TOAD for Oracle

Create Tables in Oracle Database using TOAD