Wednesday, March 25, 2015

Script to check the database size

SQL> select (a.data_size+b.temp_size+c.redo_size+d.controlfile_size)/1024 "total_size in GB"
from ( select sum(bytes)/1024/1024 data_size from dba_data_files) a,
( select nvl(sum(bytes),0)/1024/1024 temp_size from dba_temp_files ) b,
(select sum(bytes)/1024/1024 redo_size from sys.v_$log ) c,

( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024 controlfile_size from v$controlfile) d;

total_size in GB
----------------
      133.515869

No comments:

Post a Comment