Queries to find the size of an Oracle database
To find how much space has been allocated to ALL datafiles:
select sum(bytes)/1024/1024 "MB" from dba_data_files;
select sum(bytes)/1024/1024 "MB" from dba_data_files;
Size of the online redo logs:
select sum(bytes)/1024/1024 "Meg" from sys.v_$log;
select sum(bytes)/1024/1024 "Meg" from sys.v_$log;
Size of all TEMP files:
select nvl(sum(bytes),0)/1024/1024 "MB" from dba_temp_files;
select nvl(sum(bytes),0)/1024/1024 "MB" from dba_temp_files;
Size of the control files usage,
select sum(BLOCK_SIZE*FILE_SIZE_BLKS/1024/1024) "MB" from v$controlfile;
Find all the details at a time
select a.data_size+b.temp_size+c.redo_size+d.controlfile_size "total_size in MB"
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;
select sum(BLOCK_SIZE*FILE_SIZE_BLKS/1024/1024) "MB" from v$controlfile;
Find all the details at a time
select a.data_size+b.temp_size+c.redo_size+d.controlfile_size "total_size in MB"
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;
No comments:
Post a Comment