Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

Script to generate Total, Free, Used size of a Database.

$
0
0
Please change the below script as per your environment need.

set serveroutput on

declare
  total_size_b number;
  free_size_b number;
  used_size_b number;
begin

  dbms_output.enable(100000);

  select Sum(bytes) into total_size_b
  from dba_data_files;

  select Sum(bytes) into free_size_b
  from dba_free_space;

  select Sum(bytes) into used_size_b
  from dba_segments;

  dbms_output.put_line('Total: ' || TO_CHAR(Round(total_size_b/1073741824, 0), '999999999') || ' GB');
  dbms_output.put_line('Free: ' || TO_CHAR(Round(free_size_b/1073741824, 0), '999999999') || ' GB');
  dbms_output.put_line('Used: ' || TO_CHAR(Round(used_size_b/1073741824, 0), '999999999') || ' GB');

end;
/


Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>