set linesize 190 col "Buffer Hit Ratio" format a16; col "Dictionary Hit Ratio" format a20; col "Library Hit Ratio" format a17; col "RedoLog Wait" format a12; col "PGA Hit Ratio" format a13; with a as ( select to_char(round(((1-(sum(decode(name,'physical reads',value,0))/(sum(decode(name,'db block gets',value,0))+(sum(decode(name,'consistent gets',value,0))))))*100),4),'99.99') || '%' as "Buffer Hit Ratio" from v$sysstat ), b as ( select to_char(round(((1-(sum(getmisses)/sum(gets)))*100),4),'999.99') || '%' as "Dictionary Hit Ratio" from v$rowcache ), c as ( select to_char(round(100-((((sum(reloads)/sum(pins))))),4),'999.99') || '%' as "Library Hit Ratio" from v$librarycache ), d as ( select to_char(round((100-(100*sum(decode(name,'redo log space requests',value,0))/sum(decode(name,'redo entries',value,0)))),4),'999.999') || '%' as "RedoLog Wait" from sys.v_$sysstat ), e as ( select to_char(round(value,4),'999.99') ||'%' "PGA Hit Ratio" from sys.v_$pgastat where name = 'cache hit percentage' ) select * from a,b,c,d,e;