查看Oracle日志情况
SELECT TO_CHAR(first_time, 'MM/DD') DAY,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '00', 1, 0)) H00,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '01', 1, 0)) H01,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '02', 1, 0)) H02,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '03', 1, 0)) H03,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '04', 1, 0)) H04,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '05', 1, 0)) H05,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '06', 1, 0)) H06,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '07', 1, 0)) H07,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '08', 1, 0)) H08,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '09', 1, 0)) H09,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '10', 1, 0)) H10,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '11', 1, 0)) H11,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '12', 1, 0)) H12,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '13', 1, 0)) H13,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '14', 1, 0)) H14,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '15', 1, 0)) H15,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '16', 1, 0)) H16,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '17', 1, 0)) H17,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '18', 1, 0)) H18,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '19', 1, 0)) H19,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '20', 1, 0)) H20,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '21', 1, 0)) H21,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '22', 1, 0)) H22,
       SUM(DECODE(TO_CHAR(first_time, 'HH24'), '23', 1, 0)) H23,
       COUNT(*) TOTAL
  FROM (SELECT ROWNUM RN, FIRST_TIME
          FROM V$LOG_HISTORY
         WHERE first_time > sysdate - 18
          and FIRST_TIME > ADD_MONTHS(SYSDATE, -1)
         ORDER BY FIRST_TIME)
 GROUP BY TO_CHAR(first_time, 'MM/DD')

 ORDER BY MIN(RN);



阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiegh2014/article/details/46786885
个人分类: Oracle性能优化
想对作者说点什么? 我来说一句

oracle日志查看程序

2013年08月27日 2.73MB 下载

没有更多推荐了,返回首页

不良信息举报

查看Oracle日志情况

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭