ORA-00060 Deadlock Detected 详解(1)
(2013-08-01 21:24:54)
标签:
王显伟oracle死锁trc文件分ora-00600详解ora-00600死锁详解死锁产生的原因 |
分类: ORACLE常见问题处理 |
--------------------------------------------------------------------------------------------------
/dbfs/oradata/admin/htdb/udump/htdb_ora_423766.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
ORACLE_HOME = /oracle/product/10.2.0.5
System name:
Node name:
Release:
Version:
Machine:
Instance name: htdb
Redo thread mounted by this instance: 1
Oracle process number: 380
Unix process pid: 423766, image: oracle@ECMora01
对于这部分内核是数据库和主机的一些版本信息,看一言就OK了,信息价值量不大
--------------------------------------------------------------------------------------------------
*** 2013-07-31 17:12:37.244
*** SERVICE NAME:(SYS$USERS) 2013-07-31 17:12:37.215
*** SESSION ID:(1405.59555) 2013-07-31
17:12:37.215
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:
Resource
Name
TX-00730018-0000c55b
TX-00ac0009-0000715b
session 1405: DID 0001-017C-002C6A2B
session 1538: DID 0001-0132-00375797
--------------------------------------------------------------------------------------------------
Rows waited on:
Session 1538: obj - rowid = 000287D7 - AAAofXAArAABLIlAAy
Session 1405: obj - rowid = 000287D7 - AAAofXAAcAAFkfnABb
Information on the OTHER waiting sessions:
这部分告诉我们以下信息,Session 1538等待这个对像objec_id:165847,文件号:43 数据库块:307749,行号是:AAAofXAArAABLIlAAy
可以跟据以下SQL查询对像、以行文件或行号等信息
SQL>
SQL>
--------------------------------------------------------------------------------------------------
Session 1538:
这个部分显示了除产生死锁外的其它等待信息,不用关注
--------------------------------------------------------------------------------------------------
update t_contract_taxinfo a set
a.locked=0,a.updateDate=sysdate,a.taxInfoStatus=1
End of information on OTHER waiting
sessions.
Current SQL statement for this session:
update t_contract_taxinfo a set a.locked=0,a.updateDate=sysdate,payedTaxTotalAmount。。。。。。。
这部分显示产生死锁的两个session涉及到的SQL
--------------------------------------------------------------------------------------------------
产生死锁原因:
1.业务逻辑设计不合理,高并发下产生死锁
2.外键列没有索引,对外键列更新时产生死锁
3.SQL执行效率低下导致死锁
4.一条update语句导致死锁,绝大部分原因是因为更新表的列有位图索引
如何查询那些外键没有索引
select table_name,