Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: ** v$log.status
Thanks Mladen and David
It is great to get such detailed info.
If we take your example of three redo logs then you could have a situation where one is is 'CURRENT' status and two are in 'ACTIVE' status. As follows :
GROUP# STATUS
Basically given limited space is it advisable to have many smaller redo log groups instead of Oracle suggested bigger redo logs which switch once an hour.
I agree it is unlikely and might as well just get extra space but the point is to put in the best possible setup and be ready for crazy activity instead of just going by the 'thumb rule' of having one log switch per hour.
Thank you again
Mladen Gogala <mladen_at_wangtrading.com> wrote: David Hau explained this much better and in much more clear fashion then me. Here is the most important part from the usenet thread he was referring you to:
Here's the sequence of events when a log switch happens:
LGWR will update the redo log status in the control file when any of
these
occurs (and others too, that I don't know of):
So if you want the redo log status to be updated more quickly to
inactive
after a checkpoint, one way to do it is to decrease the value of
LOG_CHECKPOINT_TIMEOUT in init.ora.
Cheers,
Dave
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: mladen_at_wangtrading.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! --0-804178148-1075507149=:63846 Content-Type: text/html; charset=us-ascii <DIV>Thanks Mladen and David </DIV> <DIV> </DIV> <DIV> It is great to get such detailed info.</DIV> <DIV>If we take your example of three redo logs then you could have a situation where one is is 'CURRENT' status and two are in 'ACTIVE' status. As follows :</DIV> <DIV> </DIV> <DIV>GROUP# STATUS<BR> ---------- ----------------<BR> 1 ACTIVE<BR> 2 CURRENT<BR> 3 ACTIVE<BR></DIV> <DIV> Now if group 2 ('CURRENT') fills up or if 'alter system switch logfile' command is given then it will try to go to the next one. Since the next one (in fact both) is 'ACTIVE' it cannot be allocated and made current. Right? So in that case will the database hang? Will it wait for the next sequence redo log which is group 3 to get 'INACTIVE' or will it allocate <BR>group 1 if it becomes 'INACTIVE' before group 3. </DIV> <DIV> </DIV> <DIV>Basically given limited space is it advisable to have many smaller redo log groups instead of Oracle suggested bigger redo logs which switch once an hour. </DIV> <DIV> </DIV> <DIV>I agree it is unlikely and might as well just get extra space but the point is to put in the best possible setup and be ready for crazy activity instead of just going by the 'thumb rule' of having one log switch per hour.</DIV> <DIV> </DIV> <DIV>Thank you again </DIV> <DIV><BR><B><I>Mladen Gogala <mladen_at_wangtrading.com></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">David Hau explained this much better and in much more clear<BR>fashion then me. Here is the most important part from the usenet<BR>thread he was referring you to:<BR>**********************************************************************<BR>This makes sense if you think about where the various v$ dynamic <BR>performance<BR>views get their info from, and which Oracle background process is<BR>responsible for each task. First, note that:<BR><BR>1. v$log.status gets its redo log info from the *control file*<BR>2. v$datafile_header.checkpoint_change# and checkpoint_time get their <BR>info<BR>from the *datafile headers*.<BR><BR>Here's the sequence of events when a log switch happens:<BR><BR>1. LGWR switches to the next redo log file, changes the status of the<BR>previous redo log file from CURRENT to ACTIVE in the control file, and<BR>signals DBWR to do a checkpoint on the previous ! redo log file.<BR>2. When DBWR finishes with the checkpoint, it signals CKPT to update<BR>datafile headers and update checkpoint info (only) in the control file.<BR>This is the info read by v$datafile_header.checkpoint_change# and<BR>checkpoint_time. Note that CKPT does not update redo log info in the<BR>control file. It only deals with checkpoint info, as its name implies.<BR>3. When CKPT is done, it signals LGWR to update the redo log status in <BR>the<BR>control file from ACTIVE to INACTIVE. This is the info read by<BR>v$log.status. This update task is a low priority item for LGWR because <BR>the<BR>only process that cares about whether the redo log status is active or <BR>not<BR>is LGWR itself. The redo log status tells LGWR whether it can reuse a <BR>redo<BR>log file or not (i.e. whether checkpoint has completed on that redo log<BR>file.) That is, by delaying this operation, LGWR is not blocking the <BR>work<BR>of any other process.<BR><BR>LGWR will update the redo log status i! n the control file when any of <BR>these<BR>occurs (and others too, that I don't know of):<BR><BR>1. when LGWR periodically checks for compliance with the<BR>LOG_CHECKPOINT_TIMEOUT parameter, which says that the checkpoint <BR>position<BR>should not lag behind the latest redo record by this amount of time.<BR><BR>2. when you issue a "alter system checkpoint" which is what you did.<BR><BR>So if you want the redo log status to be updated more quickly to <BR>inactive<BR>after a checkpoint, one way to do it is to decrease the value of<BR>LOG_CHECKPOINT_TIMEOUT in init.ora.<BR><BR>Cheers,<BR>Dave<BR>**************************************************************************<BR>On 01/30/2004 03:44:29 PM, A Joshi wrote:<BR>> Mladen,<BR>> Thanks for info. So all the dirty blocks need to be written to disk<BR>> after each checkpoint. After that is done the status becomes<BR>> 'INACTIVE'. Just that sometimes this is very unpredictable.<BR>> My question : If a log switch alway! s causes a implicit checkpoint <BR>> then<BR>> what is the need for this explicit checkpoint to be given? Thank you.<BR>> <BR>> Mladen Gogala <MLADEN_at_WANGTRADING.COM>wrote:<BR>> On 01/30/2004 01:24:26 PM, A Joshi wrote:<BR>> > Hi,<BR>> > In view v$log there is a column status. This changes from current<BR>> > (if the redo log is in use) to atcive then to inactive.<BR>> Documentation<BR>> > says :<BR>> ><BR>> ><BR>> > ACTIVE: The log is active but is not the current log. It is needed<BR>> > for<BR>> > crash recovery. It may be in use for block recovery. It might or<BR>> > might<BR>> > not be archived.<BR>> ><BR>> > INACTIVE: The log is no longer needed for instance recovery. It may<BR>> > be<BR>> > in use for media recovery. It might or might not be archived.<BR>> ><BR>> > So if it is in 'ACTIVE' status : it means it is needed for<BR>> > crash/instance recover! y? So what does it mean? That changes in this<BR>> > log are still not written to data files? What else? Is this related<BR>> > to<BR>> > delayed block cleanout etc or no connection?<BR>> ><BR>> > What factor affects how long it will be in ACTIVE state before <BR>> going<BR>> > to INACTIVE? What can be changed to control how long it takes. Any<BR>> > trade off?<BR>> ><BR>> > Any detailed explanation on this will be greatly appreciated. You<BR>> can<BR>> > mail me direct or to the list. Thank you.<BR>> ><BR>> Status of active means that log has been switched, but not all of the<BR>> changes are written to the disk. It is, essentially, saying that DBWR<BR>> has some more work to do to catch up. The only log that is open by <BR>> the<BR>> instance is the one marked "CURRENT". Here is an example:<BR>> SQL> select group#,status from v$log;<BR>> <BR>> GROUP# STATUS<BR>> ---------- ----------------<BR>> 1 CURRENT<BR>> 2 INACTIVE<BR>> 3 INACTIVE<BR>> <BR>> SQL> alter system switch logfile;<BR>> <BR>> System altered.<BR>> <BR>> SQL> select group#,status from v$log;<BR>> <BR>> GROUP# STATUS<BR>> ---------- ----------------<BR>> 1 ACTIVE<BR>> 2 CURRENT<BR>> 3 INACTIVE<BR>> <BR>> So, after the checkpoint, the CKPT has updated log file headers,<BR>> corresponding markers and termination records are written to the <BR>> file,<BR>> data file headers have been updated and so has been the control file.<BR>> DBWR still has some work to do because there are still unwritten<BR>> blocks modified by transactions whose log records are in the "ACTIVE"<BR>> file. DBWR will take its time to write them down.<BR>> The only log file open by the instance is redo02:<BR>> <BR>> [root_at_tux925 root]# fuser /data/db/OraHome1/oradata/compldb/*.log<BR>> /data/db/OraHome1/oradata/compldb/redo02.lo! g: 6019<BR>> [root@tux925 root]#<BR>> <BR>> After another checkpoint, everyhing is back to normal:<BR>> <BR>> SQL> alter system checkpoint<BR>> 2 /<BR>> <BR>> System altered.<BR>> <BR>> SQL> select group#,status from v$log;<BR>> <BR>> GROUP# STATUS<BR>> ---------- ----------------<BR>> 1 INACTIVE<BR>> 2 CURRENT<BR>> 3 INACTIVE<BR>> <BR>> --<BR>> Please see the official ORACLE-L FAQ: http://www.orafaq.net<BR>> --<BR>> Author: Mladen Gogala<BR>> INET: mladen@wangtrading.com<BR>> <BR>> Fat City Network Services -- 858-538-5051 http://www.fatcity.com<BR>> San Diego, California -- Mailing list and web hosting services<BR>> ---------------------------------------------------------------------<BR>> To REMOVE yourself from this mailing list, send an E-Mail message<BR>> to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in<BR>> the message BODY, include a line containing: UNSUB ORACLE-L<BR>> (or the name of mailing list you want to be removed from). You may<BR>> also send the HELP command for other information (like subscribing).<BR>> <BR>> ---------------------------------<BR>> Do you Yahoo!?<BR>> Yahoo! SiteBuilder - Free web site building tool. Try it!<BR>-- <BR>Please see the official ORACLE-L FAQ: http://www.orafaq.net<BR>-- <BR>Author: Mladen Gogala<BR>INET: mladen@wangtrading.com<BR><BR>Fat City Network Services -- 858-538-5051 http://www.fatcity.com<BR>San Diego, California -- Mailing list and web hosting services<BR>---------------------------------------------------------------------<BR>To REMOVE yourself from this mailing list, send an E-Mail message<BR>to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in<BR>the message BODY, include a line containing: UNSUB ORACLE-L<BR>(or the name of mailing list you want to be removed from). You may<BR>also send the HELP command for other information (like subscribing).</BLOCKQUOTE><p><hr SIZE=1> Do you Yahoo!?<br> Yahoo! SiteBuilder - Free web site building tool. <a href="http://us.rd.yahoo.com/evt=21608/*http://webhosting.yahoo.com/ps/sb/"><b>Try it!</b></a> --0-804178148-1075507149=:63846-- -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: A Joshi INET: ajoshi977_at_yahoo.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Jan 30 2004 - 17:59:26 CST
![]() |
![]() |