当多个用户使用该应用程序时,我现在经常在我的应用程序中收到此“在等待资源时检测到 ora-00060 死锁”错误。我从 oracle 管理员那里得到了跟踪文件,但在阅读它时需要帮助。以下是跟踪文件中的一些数据,我希望这有助于找到原因。
*** 2013-06-25 09:37:35.324
DEADLOCK DETECTED ( ORA-00060 )
[Transaction Deadlock]
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 waits process session holds waits
TM-000151a2-00000000 210 72 SX SSX 208 24 SX SSX
TM-000151a2-00000000 208 24 SX SSX 210 72 SX SSX
session 72: DID 0001-00D2-000000C6 session 24: DID 0001-00D0-00000043
session 24: DID 0001-00D0-00000043 session 72: DID 0001-00D2-000000C6
Rows waited on:
Session 72: no row
Session 24: no row
----- Information for the OTHER waiting sessions -----
Session 24:
sid: 24 ser: 45245 audsid: 31660323 user: 90/USER
flags: (0x45) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
flags2: (0x40009) -/-/INC
pid: 208 O/S info: user: zgrid, term: UNKNOWN, ospid: 2439
image: oracle@xyz.local
client details:
O/S info: user: , term: , ospid: 1234
machine: xyz.local program:
current SQL:
delete from EMPLOYEE where EMP_ID=:1
----- End of information for the OTHER waiting sessions -----
Information for THIS session:
----- Current SQL Statement for this session (sql_id=dyfg1wd8xa9qt) -----
delete from EMPLOYEE where EMP_ID=:1
===================================================
如果有人能告诉我“死锁图::”在说什么,我将不胜感激。等待部分的行也表示没有行。
我还在一些博客中读到跟踪文件中的“sqltxt”部分可以提示原因。以下是我在该部分中看到的查询。
select /*+ all_rows */ count(1) from "USERS"."EMPLOYEE_SALARY" where EMPSAL_EMP_ID=:1
employee_salary 表在 EMPSAL_EMP_ID 列上有外键约束。
sql提示说“all_rows”,这是否意味着从员工表中删除记录时该表获得表级锁定?我目前在外键列上没有索引。在此列上添加索引会有所帮助吗?
请张贴,以防需要更多信息。
谢谢