select b.SEQUENCE#, b.FIRST_TIME,
a.SEQUENCE#, a.FIRST_TIME,
round(((a.FIRST_TIME-b.FIRST_TIME)*24)*60,2)
from v$log_history a, v$log_history b
where a.SEQUENCE# = b.SEQUENCE#+1
and b.THREAD#=1
order by a.SEQUENCE# desc
select sequence#,first_time,nexttime,round(((first_time-nexttime)*24)*60,2) diff
from (
select sequence#,first_time, lag(first_time) over(order by sequence#) nexttime
from v$log_history
where thread#=1
) order by sequence# desc
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25088941/viewspace-682460/ ,如需转载,请注明出处,否则将追究法律责任。