Latch Levels

 
 
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
raised.

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的规定,实际上是对进程获得latch进行了序列化、串行化控制。

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

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13750068/viewspace-731425/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/13750068/viewspace-731425/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值