Posted By

geekzspot on 01/24/13


Tagged

DBA


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

geekzspot


Oracle Database Free Space


 / Published in: SQL
 

This SQL will quickly show you approximately how much free space is in your database, expressed in various units of measurements.

  1. SELECT SUM(bytes) AS Bytes
  2. , ROUND(SUM(bytes)/POWER(1000,1)) AS KiloBytes
  3. , ROUND(SUM(bytes)/POWER(1000,2)) AS MegaBytes
  4. , ROUND(SUM(bytes)/POWER(1000,3)) AS GigaBytes
  5. , ROUND(SUM(bytes)/POWER(1000,4)) AS TeraBytes
  6. , ROUND(SUM(bytes)/POWER(1000,5)) AS PetaBytes
  7. , ROUND(SUM(bytes)/POWER(1000,6)) AS ExaBytes
  8. , ROUND(SUM(bytes)/POWER(1000,7)) AS ZettaBytes
  9. , ROUND(SUM(bytes)/POWER(1000,8)) AS YottaBytes
  10. FROM dba_free_space
  11. ;

Report this snippet  

You need to login to post a comment.