LibraryCacheLock的解决

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
昨晚业务系统导入资料并重建索引时一个会话突然停滞不前,用TOAD一看,一直在等待LibraryCacheLock。TOAD、OEM中都看不到此锁,会话每三秒启动一次,但每次都是等待这个锁。显然,这和数据字典有关,应该是一个索引的数据字典中的记录被锁住了,导致无法重建。可是杀光了其他ACTIVE的会话,问题仍然没有得到 解决,看来是某一个被杀死的会话持有该锁,而会话尚未回滚完全,进程仍然吊死着。现在的问题就是找这个会话了。
首先想到的文档就是9iDatabaseReference了,找到附录A,说明如下:

Thiseventcontrolstheconcurrencybetweenclientsofthelibrarycache.Itacquiresalockontheobjecthandlesothateither:

Oneclientcanpreventotherclientsfromaccessingthesameobject

Theclientcanmaintainadependencyforalongtime(forexample,nootherclientcanchangetheobject)

Thislockisalsoobtainedtolocateanobjectinthelibrarycache.

WaitTime:3seconds(1secondforPMON)

Parameters:

handleaddress

Addressoftheobjectbeingloaded

lockaddress

Addressoftheloadlockbeingused.Thisisnotthesamethingasalatchoranenqueue,itisaStateObject.

mode

Indicatesthedatapiecesoftheobjectwhichneedtobeloaded

namespace

See"namespace"


几乎等于什么都没说,不过lockaddress应该会有点用处。
转而上网搜索 解决方案,终于找到一篇metalink上的文档:
DocID:
Note:122793.1
Subject: HOWTOFINDTHESESSIONHOLDINGALIBRARYCACHELOCK
Type: BULLETIN
Status: PUBLISHED
 ContentType: TEXT/PLAIN
CreationDate: 23-OCT-2000
LastRevisionDate: 17-JUL-2002

PURPOSE
-------
 
 Insomesituationsitmayhappenyoursessionis'hanging'andisawaitingfor 
 a'Librarycachelock'.Thisdocumentdescribeshowtofindthesessionthat 
 infacthasthelockyouarewaitingfor.
 
 
SCOPE&APPLICATION
-------------------
 
Supportanalysts,dba's,..
 
 
HOWTOFINDTHESESSIONHOLDINGAALIBRARYCACHELOCK
------------------------------------------------------
 
 Commonsituations:
 
 *aDMLoperationthatishangingbecausethetablewhichisaccessediscurrently 
  undergoingchanges(ALTERTABLE).Thismaytakequitealongtimedependingon 
  thesizeofthetableandthetypeofthemodification 
  (e.g.ALTERTABLExMODIFY(col1CHAR(200)onthousandsofrecords). 
 
*ThecompilationofpackagewillhangonLibraryCacheLockandLibraryCachePin 
 ifsomeusersareexecutinganyProcedure/Functiondefinedinthesamepackage. 
 
 InthefirstsituationtheV$LOCKviewwillshowthatthesessiondoingthe 
 'ALTERTABLE'hasanexclusiveDMLenqueuelockonthetableobject(LMODE=6, 
 TYPE=TMandID1istheOBJECT_IDofthetable).Thewaitingsessionhoweverdoes 
 notshowupinV$LOCKyetsoinanenvironmentwithalotofconcurrentsessions 
 theV$LOCKinformationisinsufficienttotrackdowntheculpritblockingyour 
 operation.
 
METHOD1:SYSTEMSTATEANALYSIS
------------------------------
 
 Onewayoffindingthesessionblockingyouistoanalyzethesystemstatedump.
 Usingthesystemstateeventonecancreateatracefilecontainingdetailed 
 informationoneveryOracleprocess.Thisinformationincludesalltheresources
 held&requestedbyaspecificprocess. 1 <script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值