Skip to content

Instantly share code, notes, and snippets.

@sebastianwebber
Created November 4, 2016 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastianwebber/13a1f07311a9420cf66298a7cb12a597 to your computer and use it in GitHub Desktop.
Save sebastianwebber/13a1f07311a9420cf66298a7cb12a597 to your computer and use it in GitHub Desktop.
-- Found on: http://techxploration.blogspot.com.br/2012/06/script-to-get-oracle-database-size.html
SET SERVEROUTPUT ON
Declare
ddf Number:= 0;
dtf Number:= 0;
log_bytes Number:= 0;
total Number:= 0;
BEGIN
select sum(bytes)/power(1024,3) into ddf from dba_data_files;
select sum(bytes)/power(1024,3) into dtf from dba_temp_files;
select sum(bytes)/power(1024,3) into log_bytes from v$log;
total:= round(ddf+dtf+log_bytes, 3);
dbms_output.put_line('TOTAL DB Size is: '||total||'GB ');
END;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment