Posted By

geekzspot on 12/05/12


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

geekzspot


Oracle Database Size


 / Published in: SQL
 

This SQL will quickly show you approximately how big your database is, expressed in various units of measurement.

  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_data_files
  11. ;

Report this snippet  

You need to login to post a comment.