Advertisement

Thursday, January 17, 2019

Oracle Database - (Scripts) Log Switches per Hour (by Instance)

This blog talks about Log Switches Script

It will list the count of logswitches done every hour by the instances (Standalone or RAC)

Standalone 
select to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'),count(*)
from v$log_history
group by to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24')
order by 1
/

RAC
select inst_id, to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'),count(*)
from gv$log_history
group by to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'), inst_id
order by 2,1
/



select inst_id, to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'),count(*)
from gv$log_history
group by to_date(to_char(first_time,'DD-MON-YY HH24'),'DD-MON-YY HH24'), inst_id
order by 1,2
/  2    3    4    5

   INST_ID TO_DATE(TO_CHAR(FI   COUNT(*)
---------- ------------------ ----------
         1 03-JUL-18 11:00:00         19
         1 03-JUL-18 12:00:00         40
         1 03-JUL-18 13:00:00         39
         1 03-JUL-18 14:00:00         39
         1 03-JUL-18 15:00:00         45

         1 03-JUL-18 16:00:00         40



No comments:
Write comments