邪恶八进制信息安全团队技术讨论组's Archiver

pub!1c 2006-2-11 13:46

[转载]switch logfile VS archive log current

<P>信息来源:邪恶八进制信息安全团队</P>
<DIV>oracle文档这样解释</DIV>
<DIV>
<H4 class=SH1><FONT face="Arial, Helvetica, sans-serif">ALTER SYSTEM SWITCH LOGFILE ;</FONT></H4>
<H4 class=SH1><FONT face="Arial, Helvetica, sans-serif">SWITCH LOGFILE Clause</FONT></H4><A name=2053972></A>
<P class=BP>The <CODE><FONT face=新宋体>SWITCH</FONT></CODE> <CODE><FONT face=新宋体>LOGFILE</FONT></CODE> clause lets you explicitly force Oracle to begin writing to a new redo log file group, regardless of whether the files in the current redo log file group are full. When you force a log switch, Oracle begins to perform a checkpoint but returns control to you immediately rather than when the checkpoint is complete. To use this clause, your instance must have the database open.</P>
<P class=BP></P>
<P class=BP><FONT face=Arial></FONT></P>
<H5 class=SH2><FONT face="Arial, Helvetica, sans-serif">ALTER SYSTEM ARCHIVE LOG CURRENT ;</FONT></H5>
<H5 class=SH2><FONT face="Arial, Helvetica, sans-serif">CURRENT Clause</FONT></H5><A name=2064503></A>
<P class=BP>Specify <CODE><FONT face=新宋体>CURRENT</FONT></CODE> to manually archive the current redo log file group of the specified thread, forcing a log switch. If you omit the <CODE><FONT face=新宋体>THREAD</FONT></CODE> parameter, then Oracle archives all redo log file groups from all enabled threads, including logs previous to current logs. You can specify <CODE><FONT face=新宋体>CURRENT</FONT></CODE> only when the database is open.</P><A name=2064310></A>
<H5 class=SH3><FONT face="Arial, Helvetica, sans-serif">ALTER SYSTEM ARCHIVE LOG CURRENT NOSWITCH;</FONT></H5>
<H5 class=SH3><FONT face="Arial, Helvetica, sans-serif">NOSWITCH</FONT></H5><A name=2174362></A>
<P class=BP>Specify <CODE><FONT face=新宋体>NOSWITCH</FONT></CODE> if you want to manually archive the current redo log file group without forcing a log switch. This setting is used primarily with standby databases to prevent data divergence when the primary database shuts down. Divergence implies the possibility of data loss in case of primary database failure.</P><A name=2174361></A>
<P class=BP>You can use the <CODE><FONT face=新宋体>NOSWITCH</FONT></CODE> clause only when your instance has the database mounted but not open. If the database is open, then this operation closes the database automatically. You must then manually shut down the database before you can reopen it</P>
<P class=BP>itpub玉面飞龙斑竹这样解释:</P>
<P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script id=text2760736>在自动归档的情况下:</SPAN></FONT></P>
<P><FONT face="verdana, arial, helvetica" size=2><SPAN class=java script>lgwr切换写下一个日志文件的时候,它触发一个checkpoint 过程,这个checkpoint过程要触发DBWR去将上一个日志文件中redo修改的存储在buffer cache中的dirty buffer全部写回磁盘中,然后ckpt进程纪录scn到controlfile (增量检查点);同时lgwr还会触发archive进程 通知归档说可以归档某个日志文件了。 checkpoint过程和归档过程之间没有依赖性。<BR>当上面lwgr触发的checkpoint 过程完成后,会将日志文件的状态从active转到inactive; 这时候这个日志文件才可以被重新写。也就说 并不是日志文件被归档后就可以被覆盖。而要等待发生在该日志文件的检查点过程结束。<BR><BR>如果lgwr要覆盖一个其上检查点过程没有结束的日志文件,lgwr会等待dbwr完成,且应用session会hang住;在alter.log文件中会出现,checkpoint not complete,unable to allocate new redo log file 类似的错误</SPAN></FONT></P>
<P class=BP>当然,如果这个时候db不是自动归档,那么发出switch logfile之后,只会触发ckpt,arc进程不会触发,要使得redo归档,必须手工发出alter system archive log current</P></DIV>

页: [1]
© 1999-2008 EvilOctal Security Team