Log Switch details

set lines 120;
set pages 999;
SELECT
to_char(first_time,’YYYY-MM(MON)-DD’) day,
to_char(sum(decode(to_char(first_time,’HH24′),’00’,1,0)),’99’) “12a”,
to_char(sum(decode(to_char(first_time,’HH24′),’01’,1,0)),’99’) “1a”,
to_char(sum(decode(to_char(first_time,’HH24′),’02’,1,0)),’99’) “2a”,
to_char(sum(decode(to_char(first_time,’HH24′),’03’,1,0)),’99’) “3a”,
to_char(sum(decode(to_char(first_time,’HH24′),’04’,1,0)),’99’) “4a”,
to_char(sum(decode(to_char(first_time,’HH24′),’05’,1,0)),’99’) “5a”,
to_char(sum(decode(to_char(first_time,’HH24′),’06’,1,0)),’99’) “6a”,
to_char(sum(decode(to_char(first_time,’HH24′),’07’,1,0)),’99’) “7a”,
to_char(sum(decode(to_char(first_time,’HH24′),’08’,1,0)),’99’) “8a”,
to_char(sum(decode(to_char(first_time,’HH24′),’09’,1,0)),’99’) “9a”,
to_char(sum(decode(to_char(first_time,’HH24′),’10’,1,0)),’99’) “10a”,
to_char(sum(decode(to_char(first_time,’HH24′),’11’,1,0)),’99’) “11a”,
to_char(sum(decode(to_char(first_time,’HH24′),’12’,1,0)),’99’) “12p”,
to_char(sum(decode(to_char(first_time,’HH24′),’13’,1,0)),’99’) “1p”,
to_char(sum(decode(to_char(first_time,’HH24′),’14’,1,0)),’99’) “2p”,
to_char(sum(decode(to_char(first_time,’HH24′),’15’,1,0)),’99’) “3p”,
to_char(sum(decode(to_char(first_time,’HH24′),’16’,1,0)),’99’) “4p”,
to_char(sum(decode(to_char(first_time,’HH24′),’17’,1,0)),’99’) “5p”,
to_char(sum(decode(to_char(first_time,’HH24′),’18’,1,0)),’99’) “6p”,
to_char(sum(decode(to_char(first_time,’HH24′),’19’,1,0)),’99’) “7p”,
to_char(sum(decode(to_char(first_time,’HH24′),’20’,1,0)),’99’) “8p”,
to_char(sum(decode(to_char(first_time,’HH24′),’21’,1,0)),’99’) “9p”,
to_char(sum(decode(to_char(first_time,’HH24′),’22’,1,0)),’99’) “10p”,
to_char(sum(decode(to_char(first_time,’HH24′),’23’,1,0)),’99’) “11p”
from
v$log_history
GROUP by
to_char(first_time,’YYYY-MM(MON)-DD’)
ORDER BY
1;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: