Script to find Database size in Oracle

  • The script will provide information about database space occupancy.
  • select t.totaloc "TOTAL ALLOCATED(bytes)",
           (t.totaloc - f.totfree) "TOTAL USED",
           f.totfree "TOTAL FREE(bytes)",
           ((t.totaloc - f.totfree)/t.totaloc)*100 "% USED"
      from (select sum(bytes) totaloc from dba_data_files) t,
           (select sum(bytes) totfree from dba_free_space) f ;