Save the following code as SQL file and run it via SQL developer or SQLPlus as SYSDBA to get the database size (dont forget the / in the end).
/
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;/
No comments:
Post a Comment