Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Query to see # log switches per hour
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C06B93.CE912C80
Content-Type: text/plain
Thanks for the contribution...
However, tail -40f /direct/path/to/alert<sid>.log in Unix would work as well and will be updated in real time. To make it even more efficient, you should create an alias.
Regards,
Satar
> -----Original Message----- > From: Boivin, Patrice J [SMTP:BoivinP_at_mar.dfo-mpo.gc.ca] > Sent: Thursday, December 21, 2000 8:48 PM > To: Multiple recipients of list ORACLE-L > Subject: Query to see # log switches per hour > > Fyi, > > I adapted a query I found somewhere on the 'net, it used to give me ## for > number of switches when massive data loads were taking place. > > This will show you how often log switches take place on your database. > > select substr(time, 1, 5) day, > to_char(sum(decode(substr(time,10,2),'00',1,0)),'999') " 00 ", > to_char(sum(decode(substr(time,10,2),'01',1,0)),'999') " 01 ", > to_char(sum(decode(substr(time,10,2),'02',1,0)),'999') " 02 ", > to_char(sum(decode(substr(time,10,2),'03',1,0)),'999') " 03 ", > to_char(sum(decode(substr(time,10,2),'04',1,0)),'999') " 04 ", > to_char(sum(decode(substr(time,10,2),'05',1,0)),'999') " 05 ", > to_char(sum(decode(substr(time,10,2),'06',1,0)),'999') " 06 ", > to_char(sum(decode(substr(time,10,2),'07',1,0)),'999') " 07 ", > to_char(sum(decode(substr(time,10,2),'08',1,0)),'999') " 08 ", > to_char(sum(decode(substr(time,10,2),'09',1,0)),'999') " 09 ", > to_char(sum(decode(substr(time,10,2),'10',1,0)),'999') " 10 ", > to_char(sum(decode(substr(time,10,2),'11',1,0)),'999') " 11 ", > to_char(sum(decode(substr(time,10,2),'12',1,0)),'999') " 12 ", > to_char(sum(decode(substr(time,10,2),'13',1,0)),'999') " 13 ", > to_char(sum(decode(substr(time,10,2),'14',1,0)),'999') " 14 ", > to_char(sum(decode(substr(time,10,2),'15',1,0)),'999') " 15 ", > to_char(sum(decode(substr(time,10,2),'16',1,0)),'999') " 16 ", > to_char(sum(decode(substr(time,10,2),'17',1,0)),'999') " 17 ", > to_char(sum(decode(substr(time,10,2),'18',1,0)),'999') " 18 ", > to_char(sum(decode(substr(time,10,2),'19',1,0)),'999') " 19 ", > to_char(sum(decode(substr(time,10,2),'20',1,0)),'999') " 20 ", > to_char(sum(decode(substr(time,10,2),'21',1,0)),'999') " 21 ", > to_char(sum(decode(substr(time,10,2),'22',1,0)),'999') " 22 ", > to_char(sum(decode(substr(time,10,2),'23',1,0)),'999') " 23 " > from v$log_history > group by substr(time,1,5) > / > > > Merry Holidays, > Patrice Boivin > Systems Analyst (Oracle Certified DBA) > >
------_=_NextPart_001_01C06B93.CE912C80
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>RE: Query to see # log switches per hour</TITLE>
</HEAD>
<BODY>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Thanks for the =
contribution...</FONT>
</P>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">However, tail -40f =
/direct/path/to/alert<sid>.log in Unix would work as =
well and will be updated in real time. To make it even more efficient, =
you should create an alias.</FONT></P>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Regards,</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">Satar</FONT>
</P>
<BR>
<UL>
<P><FONT SIZE=3D1 FACE=3D"Arial">-----Original Message-----</FONT>
<BR><B><FONT SIZE=3D1 FACE=3D"Arial">From: </FONT></B> <FONT =
SIZE=3D1 FACE=3D"Arial">Boivin, Patrice J =
[SMTP:BoivinP_at_mar.dfo-mpo.gc.ca]</FONT>
<BR><B><FONT SIZE=3D1 FACE=3D"Arial">Sent: </FONT></B> <FONT =
SIZE=3D1 FACE=3D"Arial">Thursday, December 21, 2000 8:48 PM</FONT>
<BR><B><FONT SIZE=3D1 =
FACE=3D"Arial">To: </FONT></B> <FONT SIZE=3D1 =
FACE=3D"Arial">Multiple recipients of list ORACLE-L</FONT>
<BR><B><FONT SIZE=3D1 =
FACE=3D"Arial">Subject: </FONT>=
</B> <FONT SIZE=3D1 FACE=3D"Arial">Query to see # log switches per =
hour</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Fyi,</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">I adapted a query I found somewhere on =
the 'net, it used to give me ## for</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">number of switches when massive data =
loads were taking place.</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">This will show you how often log =
switches take place on your database.</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">select substr(time, 1, 5) day,</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'00',1,0)),'999') =
" 00 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'01',1,0)),'999') =
" 01 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'02',1,0)),'999') =
" 02 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'03',1,0)),'999') =
" 03 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'04',1,0)),'999') =
" 04 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'05',1,0)),'999') =
" 05 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'06',1,0)),'999') =
" 06 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'07',1,0)),'999') =
" 07 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'08',1,0)),'999') =
" 08 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'09',1,0)),'999') =
" 09 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'10',1,0)),'999') =
" 10 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'11',1,0)),'999') =
" 11 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'12',1,0)),'999') =
" 12 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'13',1,0)),'999') =
" 13 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'14',1,0)),'999') =
" 14 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'15',1,0)),'999') =
" 15 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'16',1,0)),'999') =
" 16 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'17',1,0)),'999') =
" 17 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'18',1,0)),'999') =
" 18 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'19',1,0)),'999') =
" 19 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'20',1,0)),'999') =
" 20 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'21',1,0)),'999') =
" 21 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'22',1,0)),'999') =
" 22 ",</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">to_char(sum(decode(substr(time,10,2),'23',1,0)),'999') =
" 23 " </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">from v$log_history</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">group by substr(time,1,5)</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">/</FONT>
</P>
<BR>
<P><FONT SIZE=3D2 FACE=3D"Arial">Merry Holidays,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Patrice Boivin</FONT>
Received on Thu Dec 21 2000 - 15:20:07 CST
![]() |
![]() |