enq: RO fast object reuse等待事件

本文详细介绍了Oracle 10g中RO Enqueue等待事件的问题及其解决方案。RO Enqueue用于同步前景进程与背景进程如DBWR或CKPT的工作需求。当频繁进行表截断或对象删除操作时,可能会出现该等待事件。文章提供了诊断RO Enqueue问题的SQL查询及调优建议。

New to Oracle 10g is the individual tracking of over 180 specific enqueues or internal Oracle locking mechanisms. One of these is the RO enqueue wait event for Object Reuse, and is used to synchronize the work required between a foreground process and background process such as DBWR or CKPT. This enqueue is most often seen when dropping objects or truncating tables... more ... Problem Tables typically truncate quickly and objects drop relatively fast so unless there is a major issue on your system, you may not see this event in the V$SESSION_WAIT view. It is more likely to be seen in the in the V$SYSTEM_WAIT view, in a statspack report, or trace report. For the V$SYSTEM_WAIT view a simple check to see if the TOTAL_WAITS and TIME_WAITED are high or are increasing will determine if there is a problem. SELECT event, total_waits, time_waited FROM v$system_event WHERE event like 'enq: RO%' If you find that the enqueue is excessive you may be able to see it in the V$SESSION_WAIT view through the following query. SELECT a.sid, c.pid, c.spid, a.username, b.event, b.wait_time, b.seconds_in_wait, b.p1, b.p2, b.p3 FROM v$session a, v$session_wait b, v$process c WHERE a.sid = b.sid AND a.paddr = c.addr AND b.event LIKE 'enq: RO%' Evaluation of the P1 value only restates that this lock is of type 'RO' and is in exclusive mode. At the writing of this help aid, there doesn't seem to be a documented explanation of P2 or P3. So the use of this view is limited to finding the session only. At this point, you should be able to track back to an application. You might also find the V$ENQUEUE_STAT view helpful in that it tracks detailed statistics for each enqueue. As it is never a good idea to continually add and drop tables in an application, you should look for excessive requests, (total_req#), failed requests, (failed_req#), and of course the accumulated amount of time spent on this enqueue (cum_wait_time). Use the following SQL to monitor this view. SELECT eq_type, total_req#, total_wait#, succ_req#, failed_req#, cum_wait_time FROM v$enqueue_stat WHERE eq_type = 'RO' Solutions Excessive wait on the RO enqueue is experienced by one of two events: Check application logic or if administrative tasks have occurred. Since this is a concurrency issue, logic and processes should be examined to eliminate needless DROP or TRUNCATE commands. Also better alternatives should be sought out such as the use of temporary tables or rescheduling for less concurrency. Since the RO enqueue is reliant upon checkpointing, DBWR, and buffer cache performance, tuning these areas will help in reducing the wait time for the RO enqueue locking mechanism. Problems with the RO enqueue waits often revolve around bugs in the Oracle software. This isn't new but when trouble shooting, investigations should also be done around bugs seen in checkpointing, DBWR, and the buffer cache. This is because these areas can adversely effect the time spent waiting for the RO enqueue. Expanded Definition Under normal circumstances dropping or truncating a table is a quick event. But when your database is not properly configured or application logic stresses the boundaries of normal processing you can experience problems with the RO enqueue wait event. So with a small effort to properly configure the database and with some re-visiting of application logic, this wait event should be one you will hopefully never see.




本文转自maclean_007 51CTO博客,原文链接:http://blog.51cto.com/maclean/1277917

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值