How to find the size of database?
database size is nothing but sum of CRD files.
size of database = size of Control file + size of Redo log files + size of datafiles.
Queries to find sizes of CRD files:
select sum(bytes)/1024/1024/1024 from dba_data_files ;
select sum(bytes)/1024/1024/1024 from v$log ;
select sum((cffsz+1)*cfbsz)/1024/1024/1024 from x$kcccf ;
now sum of above 3 results give size of database.
(or)
To find all in a single query use :
Select DF.TOTAL/1073741824 "DataFiles Size GB",
LOG.TOTAL/1073741824 "Redo LogSize GB",
CONTROL.TOTAL/1073741824 "Control Filesize GB" ,
(DF.TOTAL + LOG.TOTAl+ CONTROL.TOTAL)/1073741824 "Total DBSize GB" from dual,
(Select sum(a.bytes) TOTAL from dba_data_files a) DF,
(select sum(b.bytes) TOTAL from v$log b) LOG,
(Select sum((cffsz+1)*cfbsz) TOTAL from x$kcccf c) CONTROL;
cheers.......!!!!!!!
database size is nothing but sum of CRD files.
size of database = size of Control file + size of Redo log files + size of datafiles.
Queries to find sizes of CRD files:
select sum(bytes)/1024/1024/1024 from dba_data_files ;
select sum(bytes)/1024/1024/1024 from v$log ;
select sum((cffsz+1)*cfbsz)/1024/1024/1024 from x$kcccf ;
now sum of above 3 results give size of database.
(or)
To find all in a single query use :
Select DF.TOTAL/1073741824 "DataFiles Size GB",
LOG.TOTAL/1073741824 "Redo LogSize GB",
CONTROL.TOTAL/1073741824 "Control Filesize GB" ,
(DF.TOTAL + LOG.TOTAl+ CONTROL.TOTAL)/1073741824 "Total DBSize GB" from dual,
(Select sum(a.bytes) TOTAL from dba_data_files a) DF,
(select sum(b.bytes) TOTAL from v$log b) LOG,
(Select sum((cffsz+1)*cfbsz) TOTAL from x$kcccf c) CONTROL;
cheers.......!!!!!!!
No comments:
Post a Comment