首页 > Linux操作系统 > Linux操作系统 > Latch Levels

Latch Levels

原创 Linux操作系统 作者:yyp2009 时间:2012-05-30 00:58:57 0 删除 编辑
Steve Adams的书中的latch levels提到:
It is very common for an Oracle process to need to hold a number of latches
concurrently. Therefore, there might be a possibility of latching deadlocks
occurring—namely, one process holding latch A and another process holding
latch B, and both processes spinning and waiting for the alternate latch. Oracle
ensures that this cannot happen by ensuring that latches are always taken in a
defined order, when more than one latch is required. To support this, every latch
in Oracle has a level between and 15, and a 2-byte bitmap is maintained for every
process representing the levels of the latches that the process is currently holding.
When a process attempts to get a latch in willing-to-wait mode, a check is made
to ensure that it is not already holding a latch at the same level or at a higher
level. In general, if this rule is broken, an ORA-600 [504] internal error is

Contention for a high-level latch such as the redo allocation latch (level 6) can
easily exacerbate contention for lower-level latches such as the cache buffers
chains latches (level 1 in Oracle 8.1).

简单地使用level 来控制(争用相对少,这样实现简单、成本低,如果采用 lock 机制那成本太高了),避免 dead lock。

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

请登录后发表评论 登录


  • 博文量
  • 访问量