<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; ROW CACHE LOCK</title>
	<atom:link href="https://www.xifenfei.com/tag/row-cache-lock/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Sun, 22 Nov 2026 15:21:14 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>ROW CACHE LOCK等待事件</title>
		<link>https://www.xifenfei.com/2012/05/row-cache-lock%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html</link>
		<comments>https://www.xifenfei.com/2012/05/row-cache-lock%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html#comments</comments>
		<pubDate>Mon, 21 May 2012 15:32:11 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle性能优化]]></category>
		<category><![CDATA[ROW CACHE LOCK]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=3195</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2012/05/row-cache-lock%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2012/05/row-cache-lock%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html" target="_blank">ROW CACHE LOCK等待事件</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p><strong>ROW CACHE LOCK基础说明</strong><br />
ROW CACHE LOCK等待事件是一个共享池相关的等待事件。是由于对于字典缓冲的访问造成的。<br />
P1 &#8211; Cache Id<br />
P2 &#8211; Mode Held<br />
P3 &#8211; Mode Requested<br />
<br />
mode 和REQUEST的取值：<br />
KQRMNULL 0   null mode &#8211; not locked<br />
KQRMS    3   share mode<br />
KQRMX    5   exclusive mode<br />
KQRMFAIL 10  fail to acquire instance lock<br />
<br />
如果是RAC/OPS环境，前台进程发出锁请求，LCK0进程发出锁请求。如果是单实例模式，由前台进程直接发出锁请求。<br />
在RAC/OPS环境下，前台进程会循环等待锁的获取，最多会等待60秒钟。在单实例环境，前台进程会循环1000次，等待3秒钟。PMON进程无论在哪种模式，都会等待5秒钟。<br />
要注意的是单实例模式下和多实例模式下申请该锁调用的模块是不同的（kqrget()- 单实例，kqgigt()- 多实例）。<br />
如果发现这个等待十分高，一般来说可能由于2种原因，一是共享池太小了，需要增加共享池，另外一种情况是SQL分析过于频繁，对于共享池的并发访问量过大。对于任何一种情况，绝大多数情况下加大共享池会有助于降低该等待，不过加大共享池的时候也要注意，并不一定所有的情况下增加共享池都会有明显的效果，特别是对于第二种情况，精确的分析十分重要。另外进一步分析，弄清楚哪些ROW CACHE的等待最为严重，有助于解决问题。<br />
<br />
<strong>SQL查询</strong></p>
<pre class="brush: sql; title: ; notranslate">
--查询row cache lock等待
select *  from v$session_wait where wait_class = 'row cache lock';

--查询rowcache 名称
select * from v$rowcache where cache# = &amp;p1;
</pre>
<p><strong>ENQUEUE TYPE</strong><br />
DC_TABLESPACES<br />
Probably the most likely cause is the allocation of new extents. If extent sizes are set low then the application may constantly be requesting new extents and causing contention. Do you have objects with small extent sizes that are rapidly growing? (You may be able to spot these by looking for objects with large numbers of extents). Check the trace for insert/update activity, check the objects inserted into for number of extents.<br />
<br />
DC_SEQUENCES<br />
Check for appropriate caching of sequences for the application requirements.<br />
<br />
DC_USERS<br />
Deadlock and resulting &#8220;WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!&#8221; can occur if a session issues a GRANT to a user, and that user is in the process of logging on to the database.<br />
<br />
DC_SEGMENTS<br />
This is likely to be down to segment allocation. Identify what the session holding the enqueue is doing and use errorstacks to diagnose.<br />
<br />
DB_ROLLBACK_SEGMENTS<br />
This is due to rollback segment allocation. Just like dc_segments,identify what is holding the enqueue and also generate errorstacks. Remember that on a multi-node system (RAC) the holder may be on another node and so multiple systemstates from each node will be required.<br />
<br />
DC_AWR_CONTROL<br />
This enqueue is related to control of the Automatic Workload Repository. As such any operation manipulating the repository may hold this so look for processes blocking these. </p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/vlock%e8%a7%86%e5%9b%be.html" rel="bookmark" class="crp_title">V$LOCK视图相关知识</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/06/to-find-the-tx-enqueue-contention-in-a-rac-or-ops-environment.html" rel="bookmark" class="crp_title">To find the TX Enqueue contention in a RAC or OPS environment</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/cursor-pin-s-wait-on-x-%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html" rel="bookmark" class="crp_title">cursor: pin S wait on X 等待事件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/09/cursor-pin-s%e4%ba%8b%e4%bb%b6.html" rel="bookmark" class="crp_title">cursor: pin S事件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/10/%e7%b1%bb%e6%ad%a49430ms-rw-file-kct-c-line-7800-count-13-total-26874ms-time-1296124.html" rel="bookmark" class="crp_title">类此9430ms (rw) file: kct.c line: 7800 count: 13 total: 26874ms time: 1296124原因分析</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/library-cache-pin%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html" rel="bookmark" class="crp_title">library cache pin等待事件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/08/11gr2-control-file-enqueue-hold-time-tracking-dump.html" rel="bookmark" class="crp_title">11GR2 Control file enqueue hold time tracking dump</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/library-cache-latch%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html" rel="bookmark" class="crp_title">library cache latch等待事件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/systemstates%e5%88%86%e6%9e%90%e4%bc%9a%e8%af%9d%e9%98%bb%e5%a1%9e-%e9%94%81.html" rel="bookmark" class="crp_title">Systemstates分析会话阻塞&#8212;锁表</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/library-cache-lock%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html" rel="bookmark" class="crp_title">library cache lock等待事件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/02/in-memory-database-cache-%e5%85%a5%e9%97%a8%e9%85%8d%e7%bd%ae.html" rel="bookmark" class="crp_title">In-Memory Database Cache 入门配置</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/11/smon-wait-dfs-lock-handle-enq-tx-contention.html" rel="bookmark" class="crp_title">rac kill 大事物后回滚慢,smon等待DFS lock handle和enq: TX &#8211; contention</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2012/05/row-cache-lock%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
