- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
4#
发表于 2012-2-29 11:45:49
可以实现select 的hang , 实际 是 对parse 的block
如:
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> select count(*) from maclean;
COUNT(*)
----------
6485248
alter table maclean add mac1 char(2000) default 'Maclean Liu';
session 2:
First Parse :
select * from maclean where rownum<10;
hang here!
session 3 dump :
oradebug setmypid;
oradebug dump systemstate 266;
oradebug dump hanganalyze 3;
oradebug tracefile_name;
we will find wait chain:
Chain 1 : <cnode/sid/sess_srno/proc_ptr/ospid/wait_event> :
<0/159/1750/0x84e5cd10/24561/No Wait>
-- <0/142/1490/0x84e5d4f8/24558/library cache lock>
session 142 is waiting for library cache lock
SO: 0x84f5b4a8, type: 4, owner: 0x84e5d4f8, flag: INIT/-/-/0x00
(session) sid: 142 trans: (nil), creator: 0x84e5d4f8, flag: (80000041) USR/- BSY/-/-/-/-/-
DID: 0001-0010-00000102, short-term DID: 0000-0000-00000000
txn branch: (nil)
oct: 3, prv: 0, sql: 0x7d8eb1b0, psql: (nil), user: 0/SYS
O/S info: user: oracle, term: pts/1, ospid: 24557, machine: vrh8.oracle.com
program: sqlplus@vrh8.oracle.com (TNS V1-V3)
application name: sqlplus@vrh8.oracle.com (TNS V1-V3), hash value=0
waiting for 'library cache lock' blocking sess=0x(nil) seq=83 wait_time=0 seconds since wait started=10
handle address=7cce7b48, lock address=80036b60, 100*mode+namespace=c9
Dumping Session Wait History
for 'library cache lock' count=1 wait_time=983907
handle address=7cce7b48, lock address=80036b60, 100*mode+namespace=c9
for 'library cache lock' count=1 wait_time=2930517
handle address=7cce7b48, lock address=80036b60, 100*mode+namespace=c9
for 'library cache lock' count=1 wait_time=2931562
handle address=7cce7b48, lock address=80036b60, 100*mode+namespace=c9
for 'library cache lock' count=1 wait_time=2930099
handle address=7cce7b48, lock address=80036b60, 100*mode+namespace=c9
handle address=7cce7b48 lock address=80036b60
SO: 0x80036b60, type: 53, owner: 0x84f993c8, flag: INIT/-/-/0x00
LIBRARY OBJECT LOCK: lock=80036b60 handle=7cce7b48 request=S
call pin=(nil) session pin=(nil) hpc=0003 hlc=0000
htl=0x80036be0[0x804560b0,0x804560b0] htb=0x804560b0 ssga=0x80455c98
user=84f5b4a8 session=84f5b4a8 count=0 flags=RES/[0010] savepoint=0x2f17
LIBRARY OBJECT HANDLE: handle=7cce7b48 mutex=0x7cce7c78(0)
name=SYS.MACLEAN
hash=458787ae49fd6f284ccb04a892b38231 timestamp=02-09-2012 21:32:36
namespace=TABL flags=KGHP/TIM/SML/[02000000]
kkkk-dddd-llll=0000-0701-0701 lock=X pin=X latch#=3 hpc=0004 hlc=0002
lwt=0x7cce7bf0[0x80036b90,0x80036b90] ltm=0x7cce7c00[0x7cce7c00,0x7cce7c00]
pwt=0x7cce7bb8[0x7cce7bb8,0x7cce7bb8] ptm=0x7cce7bc8[0x7cce7bc8,0x7cce7bc8]
ref=0x7cce7c20[0x7cce7c20,0x7cce7c20] lnd=0x7cce7c38[0x7bef1768,0x7c8e14e0]
LIBRARY OBJECT: object=80e25bd8
type=TABL flags=EXS/LOC/UPD[0905] pflags=[0000] status=VALD load=0
DATA BLOCKS:
data# heap pointer status pins change whr
----- -------- -------- --------- ---- ------ ---
0 7d12d038 80e25cf0 I/P/A/-/- 0 NONE 00
8 80e25f58 7d70b8c8 I/P/A/-/- 1 UPDATE 00
9 7af0b9a0 7a61ba08 I/P/A/-/- 1 NONE 00
10 7af0ba28 7ab60a88 I/P/A/-/- 1 NONE 00
the select parser ask to lock the library cache object in Share mode
but it has been already locked in X mode by session 159
SO: 0x8103a0e8, type: 50, owner: 0x83ae49c8, flag: INIT/-/-/0x00
row cache enqueue: count=3 session=0x84f70c60 object=0x7fed13e8, mode=X
savepoint=0xdb2
row cache parent object: address=0x7fed13e8 cid=8(dc_objects)
hash=2b6e1cba typ=11 transaction=0x83ae49c8 flags=0000002a
own=0x7fed14b8[0x8103a118,0x8103a118] wat=0x7fed14c8[0x7fed14c8,0x7fed14c8] mode=X
status=VALID/UPDATE/-/-/-/-/-/-/-
set=0, complete=FALSE
data=
00000000 414d0007 41454c43 0000004e 00000000 00000000 00000000 00000000
00000000 00000001 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 0000d4bd 00000002 0000d4bd 02707802 25211609
1d027078 7814200f 0f1d0270 00011420 00000000 00000000 00000000 00000000
00000000 00000006
414d0007 41454c43 0000004e => Maclean
----------------------------------------
SO: 0x83a658d0, type: 36, owner: 0x83ae49c8, flag: INIT/-/-/0x00
DML LOCK: tab=54461 flg=11 chi=0
his[0]: mod=6 spn=3506
(enqueue) TM-0000D4BD-00000000 DID: 0001-000F-000003AD
lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 flag: 0x6
res: 84908490, mode: X, prv: 849084a0, own: 84f70c60, sess: 84f70c60, proc: 84e5cd10
----------------------------------------
SO: 0x7f43e620, type: 54, owner: 0x83ae49c8, flag: INIT/-/-/0x00
LIBRARY OBJECT PIN: pin=7f43e620 handle=7cce7b48 mode=X lock=0
user=84f70c60 session=84f70c60 count=1 mask=0701 savepoint=0xda5 flags=[00]
----------------------------------------
SO: 0x80055060, type: 53, owner: 0x83ae49c8, flag: INIT/-/-/0x00
LIBRARY OBJECT LOCK: lock=80055060 handle=7cce7b48 mode=X
call pin=(nil) session pin=(nil) hpc=0000 hlc=0000
htl=0x800550e0[0x81038438,0x81f23868] htb=0x81038438 ssga=0x81038020
user=84f70c60 session=84f70c60 count=1 flags=[0000] savepoint=0xa41
LIBRARY OBJECT HANDLE: handle=7cce7b48 mutex=0x7cce7c78(0)
name=SYS.MACLEAN
hash=458787ae49fd6f284ccb04a892b38231 timestamp=02-09-2012 21:32:36
namespace=TABL flags=KGHP/TIM/SML/[02000000]
kkkk-dddd-llll=0000-0701-0701 lock=X pin=X latch#=3 hpc=0004 hlc=0002
lwt=0x7cce7bf0[0x80036b90,0x80036b90] ltm=0x7cce7c00[0x7cce7c00,0x7cce7c00]
pwt=0x7cce7bb8[0x7cce7bb8,0x7cce7bb8] ptm=0x7cce7bc8[0x7cce7bc8,0x7cce7bc8]
ref=0x7cce7c20[0x7cce7c20,0x7cce7c20] lnd=0x7cce7c38[0x7bef1768,0x7c8e14e0]
LIBRARY OBJECT: object=80e25bd8
type=TABL flags=EXS/LOC/UPD[0905] pflags=[0000] status=VALD load=0
DATA BLOCKS:
data# heap pointer status pins change whr
----- -------- -------- --------- ---- ------ ---
0 7d12d038 80e25cf0 I/P/A/-/- 0 NONE 00
8 80e25f58 7d70b8c8 I/P/A/-/- 1 UPDATE 00
9 7af0b9a0 7a61ba08 I/P/A/-/- 1 NONE 00
10 7af0ba28 7ab60a88 I/P/A/-/- 1 NONE 00
We see that the heap 8 has also been pined in X mode . and the releated row cache queue has been hold in X mode . |
|