You Asked
Hi,
I have doubt on arrive at the count of redo log switch in the database. From the AWR report i can see that the log switch(derived) total is 82 and per hour value 6.83. However when i query using the below sql
SELECT INST_ID,to_char(completion_time,'DD/MM/YYYY HH24') "Archival Time", count(1) FROM Gv$archived_log
where completion_time between to_date('01-MAR-2017', 'dd-MON-YYYY') and to_date('27-MAR-2017', 'dd-MON-YYYY')
group by INST_ID,to_char(completion_time,'DD/MM/YYYY HH24')
order by to_char(completion_time,'DD/MM/YYYY HH24');
select substr(first_time,1,5) day
, sum(decode(to_char(first_time,'HH24'), '00', 1, 0 )) "00"
, sum(decode(to_char(first_time,'HH24'), '01', 1, 0 )) "01"
, sum(decode(to_char(first_time,'HH24'), '02', 1, 0 )) "02"
, sum(decode(to_char(first_time,'HH24'), '03', 1, 0 )) "03"
, sum(decode(to_char(first_time,'HH24'), '04', 1, 0 )) "04"
, sum(decode(to_char(first_time,'HH24'), '05', 1, 0 )) "05"
, sum(decode(to_char(first_time,'HH24'), '06', 1, 0 )) "06"
, sum(decode(to_char(first_time,'HH24'), '07', 1, 0 )) "07"
, sum(decode(to_char(first_time,'HH24'), '08', 1, 0 )) "08"
, sum(decode(to_char(first_time,'HH24'), '09', 1, 0 )) "09"
, sum(decode(to_char(first_time,'HH24'), '10', 1, 0 )) "10"
, sum(decode(to_char(first_time,'HH24'), '11', 1, 0 )) "11"
, sum(decode(to_char(first_time,'HH24'), '12', 1, 0 )) "12"
, sum(decode(to_char(first_time,'HH24'), '13', 1, 0 )) "13"
, sum(decode(to_char(first_time,'HH24'), '14', 1, 0 )) "14"
, sum(decode(to_char(first_time,'HH24'), '15', 1, 0 )) "15"
, sum(decode(to_char(first_time,'HH24'), '16', 1, 0 )) "16"
, sum(decode(to_char(first_time,'HH24'), '17', 1, 0 )) "17"
, sum(decode(to_char(first_time,'HH24'), '18', 1, 0 )) "18"
, sum(decode(to_char(first_time,'HH24'), '19', 1, 0 )) "19"
, sum(decode(to_char(first_time,'HH24'), '20', 1, 0 )) "20"
, sum(decode(to_char(first_time,'HH24'), '21', 1, 0 )) "21"
, sum(decode(to_char(first_time,'HH24'), '22', 1, 0 )) "22"
, sum(decode(to_char(first_time,'HH24'), '23', 1, 0 )) "23"
from v$log_history
group by substr(first_time,1,5)
I am getting the count per hours between 12 and 18.
Regards,
Dhanasekarf
and Connor said...
From the docs for V$ARCHIVED_LOG
"If the log is archived twice, there will be two archived log records with the same THREAD#, SEQUENCE#, and FIRST_CHANGE#"
So if (for example) have a dataguard node, or any other form of secondary archive destion, you will be getting multiple rows in V$ARCHIVED_LOG compared to V$LOG_HISTORY.
Rating
(1 rating)
Is this answer out of date? If it is, please let us know via a Comment