标签:roo select HERE fir read his ext from rate
SELECT tim, gscn, round(rate), round((chk16kscn - gscn)/24/3600/32/1024,90) "Headroom" FROM ( select tim, gscn, rate, (( ((to_number(to_char(tim,‘YYYY‘))-1988)*12*31*24*60*60) + ((to_number(to_char(tim,‘MM‘))-1)*31*24*60*60) + (((to_number(to_char(tim,‘DD‘))-1))*24*60*60) + (to_number(to_char(tim,‘HH24‘))*60*60) + (to_number(to_char(tim,‘MI‘))*60) + (to_number(to_char(tim,‘SS‘))) ) * (16*1024)) chk16kscn from ( select FIRST_TIME tim , FIRST_CHANGE# gscn, ((NEXT_CHANGE#-FIRST_CHANGE#)/ ((NEXT_TIME-FIRST_TIME)*24*60*60)) rate from (select first_time, lead(first_time, 1) over (order by first_time) as next_time, FIRST_CHANGE#, NEXT_CHANGE# from v$log_history where thread#=1) where (next_time > first_time) ) )where tim > sysdate - 3 order by tim desc;
标签:roo select HERE fir read his ext from rate
原文地址:https://www.cnblogs.com/jtcr/p/9491913.html