首页 > Linux操作系统 > Linux操作系统 > Log Switch Triggers 及Force SCN

Log Switch Triggers 及Force SCN

原创 Linux操作系统 作者:tolywang 时间:2011-05-18 09:46:22 0 删除 编辑


A log switch is when Oracle stops writing to the current log file, closes it, opens the next log file, and begins writing to the new log file. There are three conditions that cause LGWR to perform. a log switch.
  1. The normal cause of a log switch is when a process generating redo is unable to allocate space in the log buffer, because there is insufficient space left in the current log file. That process posts LGWR to perform. a log switch, and the session sleeps on a log file switch completion wait event.

  2. Log switches may be forced manually in the current thread using the ALTER SYSTEM SWITCH LOGFILE command, or in all enabled threads using the ALTER SYSTEM ARCHIVE LOG CURRENT command.

  3. Log switches may also be forced automatically in relatively idle threads of an Oracle parallel server database, to secure recoverability. Whenever a log file is reused in any thread, the force SCN recorded in the database entry of the controlfile is advanced to 1 beyond the high SCN of the reused log file (unless the force SCN was already higher). If the low SCN for the current log file in any enabled thread thereby falls behind the force SCN, a log switch is forced in that thread. This allows that log file to be archived. Until that log file is archived, newer redo in the archived copy of the recently reused log file might not be able to be applied in some recovery scenarios, or to a standby database.

    If a thread requiring a forced log switch is not open, the instance that raised the force SCN will perform. the log switch on behalf of the closed thread, and the first available ARCn process in any instance will archive the log file. However, if the thread is open, its instance is prompted to perform. these actions itself. This is done by taking a KK instance lock. The LGWR process in each instance holds the KK instance lock on its own thread. The id2 field identifies the thread number. When this lock is taken by another instance, LGWR recognizes that a forced log switch is required. 

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

上一篇: bbbbbbb
请登录后发表评论 登录
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。


  • 博文量
  • 访问量