欢迎来到天天文库
浏览记录
ID:40562303
大小:307.00 KB
页数:41页
时间:2019-08-04
《metalink关于latch free的介绍》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、文档ID:注释:34576.1主题:WAITEVENT:"latchfree"ReferenceNote类型:REFERENCE状态:PUBLISHED内容类型:TEXT/X-HTML创建日期:27-FEB-1996上次修订日期:11-NOV-2002"latchfree"ReferenceNoteThisisareferencenoteforthewaitevent"latchfree"whichincludesthefollowingsubsections:·Briefdefinition·Individualwaitdetails(eg:For
2、waitsseenin)·Systemwidewaitdetails(eg:Forwaitsseenin)·Reducingwaits/waittimesSeeforanintroductiontoWaitEvents.Definition:·Versions:7.0-9.2Documentation:9.0·Latchesarelikeshortdurationlocksthatprotectcriticalbitsofcode.This
3、waitindicatesthattheprocessiswaitingforalatchthatiscurrentlybusy(heldbyanotherprocess).IndividualWaits: Parameters:·P1=Latchaddress·P2=Latchnumber·P3=Tries·LatchaddressTheaddressofthelatchthattheprocessiswaitingfor.ThehexadecimalvalueofP1(P1RAW)canbeusedtodeterminewhichlatchisw
4、aitedforthus:SELECTname,'Child'
5、
6、child#,gets,misses,sleepsFROMv$latch_childrenWHEREaddr='&P1RAW'UNIONSELECTname,null,gets,misses,sleepsFROMv$latchWHEREaddr='&P1RAW';Thiswillshow"ChildN"inthesecondcolumnifthelatchisachildlatch.·LatchnumberThisisthelatchnumberthatindexestheV$LATC
7、HNAMEview:SELECT*FROMv$latchnameWHERElatch#=&P2;Notethatthelatchnumberforagivensetoflatchescanvarybetweenreleases/platformssoitisbesttoavoidhardcodingP2orLATCH#inSQLscripts.·TriesThisisbasicallyacounterthatcountsthenumberoftimeswetriedtogetthelatch(slowwithspinning)andtheproces
8、shadtosleep.Seethe"WaitTime"notesbelow. WaitTime:Whenasessionwaitsonlatchfreeiteffectivelysleepsforashorttimethenre-teststhelatchtoseeifitisfree.IfitstillcannotbeacquiredthenP3isincrementedandthesessionwaitsagain.Thewaittimeincreasesexponentiallyanddoesnotincludespinningonthela
9、tch(activewaiting).Themaximumwaittimedependsonthenumberoflatchesthattheprocessisholding.Thereisanexponentialbackoff(upto2seconds)betweeneachattempttogetthelatch.Forcertainlatchesawaitingsessionmaybepostedoncethelatchisfree.Oracle9iusesthis"latchposting"farmorethanOracle8i(andea
10、rlier)releases.TheSECONDS_IN_WAITfigurein
此文档下载收益归作者所有