select sequence#,
to_char(first_time, 'yyyy-mm-dd hh24:mi') || ' ' ||
to_char(nexttime, 'hh24:mi'),
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
and trunc(first_time) >= sysdate - 8)
where round(((first_time - nexttime) * 24) * 60, 2) > 0
order by sequence# desc;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26390465/viewspace-1793115/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26390465/viewspace-1793115/