- 最后登录
- 2017-10-17
- 在线时间
- 93 小时
- 威望
- 157
- 金钱
- 2803
- 注册时间
- 2012-5-18
- 阅读权限
- 50
- 帖子
- 98
- 精华
- 3
- 积分
- 157
- UID
- 437
|
2#
发表于 2012-6-12 13:08:42
在11.2.0.2.0上做了实验,步骤如下
会话1,PID=66
- [oracle@GG-rac1 ~]$ export ORACLE_SID=sbdb1
- [oracle@GG-rac1 ~]$ sqlplus / as sysdba
- SQL*Plus: Release 11.2.0.2.0 Production on Tue Jun 12 12:36:30 2012
- Copyright (c) 1982, 2010, Oracle. All rights reserved.
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
- With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
- Data Mining and Real Application Testing options
- SQL> select pid from v$process where addr=(select paddr from v$session where sid=userenv('SID'));
- PID
- ----------
- 66
- SQL> alter system set "_trace_events"='10000-10999:255:66,67';
- System altered.
- SQL> update t_clevernby set id=11 where id=1;
- 1 row updated.
- SQL> update t_clevernby set id=22 where id=2;
- update t_clevernby set id=22 where id=2
- *
- ERROR at line 1:
- ORA-00060: deadlock detected while waiting for resource
- SQL> commit;
- Commit complete.
- SQL> oradebug setmypid
- Statement processed.
- SQL> oradebug dump errorstack 4
- Statement processed.
复制代码
会话2,PID=67
- [root@GG-rac1 ~]# su - oracle
- [oracle@GG-rac1 ~]$ export ORACLE_SID=sbdb1
- [oracle@GG-rac1 ~]$ sqlplus / as sysdba
- SQL*Plus: Release 11.2.0.2.0 Production on Tue Jun 12 12:36:43 2012
- Copyright (c) 1982, 2010, Oracle. All rights reserved.
- Connected to:
- Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
- With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
- Data Mining and Real Application Testing options
- SQL> select pid from v$process where addr=(select paddr from v$session where sid=userenv('SID'));
- PID
- ----------
- 67
- SQL> update t_clevernby set id=222 where id=2;
- 1 row updated.
- SQL> update t_clevernby set id=111 where id=1;
- 0 rows updated.
- SQL> commit;
- Commit complete.
- SQL> oradebug setmypid
- Statement processed.
- SQL> oradebug dump errorstack 4
- Statement processed.
复制代码
KSTTrace.rar
(842.08 KB, 下载次数: 1853)
在66.trc中可以看到
- 2012-06-12 12:38:48.672238 :8766BA98:db_trace:ksq.c@7632:ksqgtlctx(): [10704:66:93] ksqgtl: acquire TX-00060021-0000121e mode=X flags=GLOBAL|LONG why="row lock contention"
- 2012-06-12 12:38:48.672331 :8766BA99:db_trace:kju.c@1224:kjuef(): [10425:66:93] kjuef: [0x60021][0x121e],[TX][ext 0x7fff,0x0]
- 2012-06-12 12:38:48.672433 :8766BA9A:db_trace:ksl2.c@2542:kslwtbctx(): [10005:66:93] KSL WAIT BEG [enq: TX - row lock contention] 1415053318/0x54580006 393249/0x60021 4638/0x121e wait_id=52 seq_num=59 snap_id=1
- 2012-06-12 12:38:49.173483 :8766BB0B:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:49.674485 :8766BB56:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:50.175483 :8766BBA8:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:50.175483*:8766BBA9:sql_mon_query:keswx.c@6154:keswxCurPushMonitoring(begin): xsc=0x2adbd5a24b50 monCtx=(nil) estart=1339475928 eid=16777218 ctx=0xff403460 cwh=0x2adbd5a209b8 cpu=0 buffg=9 interb=0 r=0 rb=0 w=0 wb=0
- 2012-06-12 12:38:50.175483*:8766BBAA:sql_mon_query:keswx.c@2845:keswxCurPrepare(): Allocate monitor context: xsc=0x2adbd5a24b50 curCtx=0x2adbd5a245a0 pubTabIdxCnt=0
- 2012-06-12 12:38:50.175483*:8766BBAB:sql_mon_query:keswx.c@6200:keswxCurPushMonitoring(): clear monitoring flag for xsc=0x2adbd5a24b50
- 2012-06-12 12:38:50.175483*:8766BBAC:sql_mon_query:keswx.c@6332:keswxCurPushMonitoring(end): full monitoring not yet started for xsc=0x2adbd5a24b50
- 2012-06-12 12:38:50.676480 :8766BC29:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:51.177480 :8766BCB4:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:51.678480 :8766BD13:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:52.179484 :8766BD74:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:52.179484*:8766BD75:sql_mon_query:keswx.c@6154:keswxCurPushMonitoring(begin): xsc=0x2adbd5a24b50 monCtx=0x2adbd5a245a0 estart=1339475928 eid=16777218 ctx=0xff403460 cwh=0x2adbd5a209b8 cpu=0 buffg=0 interb=0 r=0 rb=0 w=0 wb=0
- 2012-06-12 12:38:52.179484*:8766BD76:sql_mon_query:keswx.c@6332:keswxCurPushMonitoring(end): full monitoring not yet started for xsc=0x2adbd5a24b50
- 2012-06-12 12:38:52.680480 :8766BDBA:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:53.181481 :8766BE17:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:53.682478 :8766BEF7:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:54.183479 :8766BFB3:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:54.183479*:8766BFB4:sql_mon_query:keswx.c@6154:keswxCurPushMonitoring(begin): xsc=0x2adbd5a24b50 monCtx=0x2adbd5a245a0 estart=1339475928 eid=16777218 ctx=0xff403460 cwh=0x2adbd5a209b8 cpu=0 buffg=0 interb=0 r=0 rb=0 w=0 wb=0
- 2012-06-12 12:38:54.183479*:8766BFB5:sql_mon_query:keswx.c@6332:keswxCurPushMonitoring(end): full monitoring not yet started for xsc=0x2adbd5a24b50
- 2012-06-12 12:38:54.684474 :8766C03B:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:55.185477 :8766C0B6:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:55.686473 :8766C0FE:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:56.187476 :8766C140:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:56.187476*:8766C141:sql_mon_query:keswx.c@6154:keswxCurPushMonitoring(begin): xsc=0x2adbd5a24b50 monCtx=0x2adbd5a245a0 estart=1339475928 eid=16777218 ctx=0xff403460 cwh=0x2adbd5a209b8 cpu=0 buffg=0 interb=0 r=0 rb=0 w=0 wb=0
- 2012-06-12 12:38:56.187476*:8766C142:sql_mon_query:keswx.c@6332:keswxCurPushMonitoring(end): full monitoring not yet started for xsc=0x2adbd5a24b50
- 2012-06-12 12:38:56.688470 :8766C1E3:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:57.189536 :8766C289:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:57.690468 :8766C2F4:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:58.191470 :8766C378:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:58.191470*:8766C379:sql_mon_query:keswx.c@6154:keswxCurPushMonitoring(begin): xsc=0x2adbd5a24b50 monCtx=0x2adbd5a245a0 estart=1339475928 eid=16777218 ctx=0xff403460 cwh=0x2adbd5a209b8 cpu=0 buffg=0 interb=0 r=0 rb=0 w=0 wb=0
- 2012-06-12 12:38:58.191470*:8766C37A:sql_mon_query:keswx.c@6332:keswxCurPushMonitoring(end): full monitoring not yet started for xsc=0x2adbd5a24b50
- 2012-06-12 12:38:58.692488 :8766C3C8:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=50
- 2012-06-12 12:38:58.799543 :8766C3CD:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=10
- 2012-06-12 12:38:58.799546 :8766C3CE:db_trace:ksl2.c@13718:ksliwat(): [10005:66:93] KSL POST RCVD poster=43 num=3338 loc='ksv2.h LINE:1673 ID:ksvpst: workdone' id1=0 id2=0 name= type=0 fac#=3 posted=0x1 may_be_posted=1
- 2012-06-12 12:38:59.021847 :8766C3F4:db_trace:kju.c@1224:kjuef(): [10425:66:93] kjuef: [0x60021][0x121e],[TX][ext 0x7fff,0x0]
- 2012-06-12 12:38:59.021852 :8766C3F5:db_trace:ksl2.c@13590:ksliwat(): [10005:66:93] KSL FACILITY WAIT fac#=3 time_waited_csecs=22
- 2012-06-12 12:38:59.021854 :8766C3F6:db_trace:ksl2.c@13718:ksliwat(): [10005:66:93] KSL POST RCVD poster=13 num=270089 loc='kji.h LINE:3275 ID:kjata: wake up enqueue owner' id1=0 id2=0 name= type=0 fac#=3 posted=0x3 may_be_posted=1
- 2012-06-12 12:38:59.021861 :8766C3F7:db_trace:ksl2.c@2676:kslwtectx(): [10005:66:93] KSL WAIT END [enq: TX - row lock contention] 1415053318/0x54580006 393249/0x60021 4638/0x121e wait_id=52 seq_num=59 snap_id=1
- 2012-06-12 12:38:59.021863 :8766C3F8:db_trace:ksl2.c@2684:kslwtectx(): [10005:66:93] KSL WAIT END wait times (usecs) - snap=10349422, exc=10349422, tot=10349422
- 2012-06-12 12:38:59.021863*:RAC_ENQ:kju.c@2847:kjusuc(): convert request failed with status=[0xF].
- 2012-06-12 12:38:59.021888 :8766C3F9:db_trace:ksq.c@8142:ksqgtlctx(): [10704:66:93] ksqgtl: FAILURE: DEADLOCK
复制代码
会话1请求TX-00060021-0000121e未果后进入KSL WAIT,10s后出现ksqgtl: FAILURE: DEADLOCK
请刘大过目,不过有个问题
PID=67的KST Trace不知为何只有12:39:15之后的数据,因此感觉实验结果可能有误 |
|