专家解释一下下面的deadlock,谢谢

[复制链接]
查看11 | 回复3 | 2007-10-20 08:38:44 | 显示全部楼层 |阅读模式
DEADLOCK DETECTED
Current SQL statement for this session:
DELETE FROM tabx WHERE col1 = :B2 AND col2 = :B1
----- PL/SQL Call Stack -----
objectlineobject
handlenumbername
c0000000700c16781400package body x
c000000070984420 245package body x2
c000000070984420 276package body x3
c00000007096b3e0 1anonymous block
The following deadlock is not an ORACLE error. It is a
deadlock due to user error in the design of an application
or from issuing incorrect ad-hoc SQL. The following
information may aid in determining the deadlock:
Deadlock graph:

---------Blocker(s)-----------------Waiter(s)---------
Resource Name
process session holds waitsprocess session holds waits
TM-00002257-0000000041 405SX SSX 14 408SX SSX
TM-00002257-0000000014 408SX SSX 41 405SX SSX
session 405: DID 0001-0029-000026E2
session 408: DID 0001-000E-000024A7
session 408: DID 0001-000E-000024A7
session 405: DID 0001-0029-000026E2
Rows waited on:
Session 408: obj - rowid = 000021F9 - AAACH5AAJAAAAAAAAA
(dictionary objn - 8697, file - 9, block - 0, slot - 0)
Session 405: obj - rowid = 000021F9 - AAACH5AAJAAAAdMAAA
(dictionary objn - 8697, file - 9, block - 1868, slot - 0)
Information on the OTHER waiting sessions:
Session 408:
pid=14 serial=xx audsid=5586777 user: xxxx
O/S info: xxx: , ospid: 25734, machine: xxxx

program: xxxx(TNS V1-V3)
application name: xxx@xxx (TNS V1-V3), hash value=0
Current SQL Statement:
DELETE FROM tabx WHERE col1 = :B2 AND col2 = :B1
End of information on OTHER waiting sessions.
===================================================
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
一般来说,如果有出现对rowid的等待,都应该是TX的等待,并且请求模式为X
而这里的例子是TM类型的锁,所以很象是父表与子表之间的锁,且模式为SX或SSX
父表与子表的互锁问题,一般只出现在9i以前的版本,并且子表的外键上未建索引的情况
请楼主查一下表的结构
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
因为等待的是ssx锁,所以请检查一下你的主外键关系。
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
http://zhang41082.itpub.net/post/7167/302927
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行