前2天发现某客户rac数据库中一实例中频繁出现library cache lock等待,且均是同一session中出现这种等待,通过查询视图发现对应为Oracle的后台进程CJQ0; CJQ0为Oracle中检测自动执行作业(job or scheduler)队列的进程,一般情况下均处于空闲等待"rdbms ipc message"中。library cache lock是Oracle中著名的DDL锁之一,这里不加鏖述。 PROCESS 19: ---------------------------------------- SO: 70000048d7fe5d8, type: 2, owner: 0, flag: INIT/-/-/0x00 (process) Oracle pid=19, calls cur/top: 70000048dd3e870/70000048dd3e870, flag: (2) SYSTEM int error: 0, call error: 0, sess error: 0, txn error 0 (post info) last post received: 0 0 55 last post received-location: kjata: wake up enqueue owner last process to post me: 70000048e83b620 1 6 last post sent: 0 0 24 last post sent-location: ksasnd last process posted by me: 70000048d7fbe78 1 6 (latch info) wait_event=0 bits=0 Process Group: DEFAULT, pseudo proc: 70000048e98ea18 O/S info: user: orauser, term: UNKNOWN, ospid: 1273882 OSD pid info: Unix process pid: 1273882, image: oracle@p570bl2 (CJQ0) SO: 70000048ed81538, type: 4, owner: 70000048d7fe5d8, flag: INIT/-/-/0x00 (session) sid: 2241 trans: 0, creator: 70000048d7fe5d8, flag: (51) USR/- BSY/-/-/-/-/- DID: 0002-0013-00000003, short-term DID: 0002-0013-00000004 txn branch: 0 oct: 0, prv: 0, sql: 0, psql: 0, user: 0/SYS service name: SYS$BACKGROUND waiting for 'rdbms ipc message' blocking sess=0x0 seq=7721 wait_time=0 seconds since wait started=1 timeout=1f4, =0, =0 Dumping Session Wait History for 'library cache lock' count=1 wait_time=386 handle address=70000045ded8cd0, lock address=7000004423b6c18, 100*mode+namespace=15f for 'rdbms ipc message' count=1 wait_time=4882832 timeout=1f4, =0, =0 for 'library cache lock' count=1 wait_time=301 handle address=70000045ded8cd0, lock address=7000004423b6c18, 100*mode+namespace=15f for 'rdbms ipc message' count=1 wait_time=4882837 timeout=1f4, =0, =0 for 'library cache lock' count=1 wait_time=355 handle address=70000045ded8cd0, lock address=7000004423b6c18, 100*mode+namespace=15f for 'rdbms ipc message' count=1 wait_time=4885482 timeout=1f4, =0, =0 for 'library cache lock' count=1 wait_time=552 handle address=70000045ded8cd0, lock address=7000004423b6c18, 100*mode+namespace=15f for 'rdbms ipc message' count=1 wait_time=4882831 timeout=1f4, =0, =0 for 'library cache lock' count=1 wait_time=419 handle address=70000045ded8cd0, lock address=7000004423b6c18, 100*mode+namespace=15f for 'rdbms ipc message' count=1 wait_time=4882833 timeout=1f4, =0, =0 temporary object counter: 0 SO: 7000004423b6c18, type: 53, owner: 70000048ed81538, flag: INIT/-/-/0x00 LIBRARY OBJECT LOCK: lock=7000004423b6c18 handle=70000045ded8cd0 mode=N call pin=0 session pin=0 hpc=0000 hlc=0000 htl=7000004423b6c98[700000472977d60,700000472977d60] htb=700000472977d60 ssga=700000472976d88 user=70000048ed81538 session=70000048ed81538 count=0 flags=LRU/[4000] savepoint=0x98bebf LIBRARY OBJECT HANDLE: handle=70000045ded8cd0 mtx=70000045ded8e00(0) cdp=0 name=SYS.LAST_OBSERVED_EVENT hash=2d935a2f0679a3150e306aa65d9471ec timestamp=01-23-2009 13:46:29 namespace=JSGA flags=KGHP/TIM/XLR/[00000020] kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=8 hpc=001e hlc=001e lwt=70000045ded8d78[70000045ded8d78,70000045ded8d78] ltm=70000045ded8d88[70000045ded8d88,70000045ded8d88] pwt=70000045ded8d40[70000045ded8d40,70000045ded8d40] ptm=70000045ded8d50[70000045ded8d50,70000045ded8d50] ref=70000045ded8da8[70000045ded8da8,70000045ded8da8] lnd=70000045ded8dc0[70000045ded8dc0,70000045ded8dc0] LOCK INSTANCE LOCK: id=EZ2d935a2f0679a315 PIN INSTANCE LOCK: id=GZ2d935a2f0679a315 mode=S release=F flags=[00] INVALIDATION INSTANCE LOCK: id=IV000014f9170e2f1e mode=S LIBRARY OBJECT: object=70000045ded8800 type=JSGA flags=EXS/LOC[0005] pflags=[0000] status=VALD load=0 DATA BLOCKS: data# heap pointer status pins change whr ----- -------- -------- --------- ---- ------ --- 0 70000045ded8c10 70000045ded8918 I/-/A/-/- 0 NONE 00
本文转自maclean_007 51CTO博客,原文链接:http://blog.51cto.com/maclean/1276682