Redo Log Switch Sıklığı
Redo LOG dosyalarının switch sıklığı bize database’imizin hangi saat aralıklarında daha yoğun kullanıldıgına dair ipucu verir. İdeal switch etme sıklığı 15-20 dk olmalıdır. Redo log dosyalarının boyutları da bu konuda önem arzediyor, database’e göre küçük kalan redo LOG dosyaları daha çok switch edecektir, ve redo waitlere sebep olacaktır. Redo logların büyük size’lı olması da instance recovery(SMON Processi açılışta otomatik olarak yapar) süresini uzatacaktır. Redo logların yeniden boyutlandırılması ile ilgili başka bir yazı yazacağım.
Şimdi redo log dosyalarının günlük switch sıklığı ile ilgili bilgi alacağımız bir sorgu yazalım.
select
to_char(first_time,'YYYY-MM-DD') DATED,
to_char(first_time,'DAY') DAY,
to_char(sum(decode(to_char(first_time,'HH24'),'00',1,0)),'999') "00",
to_char(sum(decode(to_char(first_time,'HH24'),'01',1,0)),'999') "01",
to_char(sum(decode(to_char(first_time,'HH24'),'02',1,0)),'999') "02",
to_char(sum(decode(to_char(first_time,'HH24'),'03',1,0)),'999') "03",
to_char(sum(decode(to_char(first_time,'HH24'),'04',1,0)),'999') "04",
to_char(sum(decode(to_char(first_time,'HH24'),'05',1,0)),'999') "05",
to_char(sum(decode(to_char(first_time,'HH24'),'06',1,0)),'999') "06",
to_char(sum(decode(to_char(first_time,'HH24'),'07',1,0)),'999') "07",
to_char(sum(decode(to_char(first_time,'HH24'),'08',1,0)),'999') "08",
to_char(sum(decode(to_char(first_time,'HH24'),'09',1,0)),'999') "09",
to_char(sum(decode(to_char(first_time,'HH24'),'10',1,0)),'999') "10",
to_char(sum(decode(to_char(first_time,'HH24'),'11',1,0)),'999') "11",
to_char(sum(decode(to_char(first_time,'HH24'),'12',1,0)),'999') "12",
to_char(sum(decode(to_char(first_time,'HH24'),'13',1,0)),'999') "13",
to_char(sum(decode(to_char(first_time,'HH24'),'14',1,0)),'999') "14",
to_char(sum(decode(to_char(first_time,'HH24'),'15',1,0)),'999') "15",
to_char(sum(decode(to_char(first_time,'HH24'),'16',1,0)),'999') "16",
to_char(sum(decode(to_char(first_time,'HH24'),'17',1,0)),'999') "17",
to_char(sum(decode(to_char(first_time,'HH24'),'18',1,0)),'999') "18",
to_char(sum(decode(to_char(first_time,'HH24'),'19',1,0)),'999') "19",
to_char(sum(decode(to_char(first_time,'HH24'),'20',1,0)),'999') "20",
to_char(sum(decode(to_char(first_time,'HH24'),'21',1,0)),'999') "21",
to_char(sum(decode(to_char(first_time,'HH24'),'22',1,0)),'999') "22",
to_char(sum(decode(to_char(first_time,'HH24'),'23',1,0)),'999') "23"
from v$log_history
where trunc(first_time) > trunc(sysdate-7) and trunc(first_time) <= trunc(sysdate)
group by to_char(first_time,'YYYY-MM-DD'),to_char(first_time,'DAY')
order by 1 desc;
Sonucumuz(RAC ortamlarda tüm instanceler gelir)
DATED DAY 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
2015-06-11 THURSDAY 16 34 18 12 17 12 12 12 12 12 12 12 12 12 12 12 12 12 14 14 12 17 25 52
2015-06-10 WEDNESDAY 15 33 17 12 19 12 12 12 12 12 12 12 12 12 12 12 12 12 14 12 15 17 26 53
2015-06-09 TUESDAY 22 52 25 28 15 13 12 12 12 12 12 12 12 12 12 12 12 12 14 12 16 18 26 48
2015-06-08 MONDAY 12 12 12 12 13 12 12 12 12 32 12 12 12 15 12 12 12 12 14 12 16 16 24 12
2015-06-07 SUNDAY 12 12 14 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 14 12 12 12 12 12
2015-06-06 SATURDAY 32 31 20 13 17 12 13 12 12 12 12 12 12 12 12 12 12 12 14 12 12 12 12 12
Redo loglarla ilgili bilgi alabileceğimiz diğer viewler;
--Arşive çıkmış log bilgileri
SELECT * FROM v$archived_log k ORDER BY k.first_time DESC;
--Genel redo log bilgileri(size, status vb)
SELECT * FROM v$log;
--Redo log dizinleri
SELECT * FROM v$logfile;
-- Redo log history
SELECT * FROM v$log_history