当前位置:  数据库>oracle

解决 ORA-00060: Deadlock detected 小例

    来源: 互联网  发布时间:2017-05-24

    本文导语: 数据库版本: SQL > select * from v$version; BANNER----------------------------------------------------------------PL/SQL Release 10.2.0.5.0 - ProductionCORE 10.2.0.5.0 ProductionTNS for Linux: Version 10.2.0.5.0 - ProductionNLSRTL Version 10.2.0.5.0 - Production 事件:数据库产生死锁...

数据库版本:

SQL > select * from v$version;

BANNER
----------------------------------------------------------------
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production

事件:数据库产生死锁:

ORA-00060: Deadlock detected

 

alert 日志如下:

ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13794.trc.
Wed Jul 10 12:39:00 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13792.trc.
Wed Jul 10 12:40:02 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13794.trc.
Wed Jul 10 12:41:56 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13790.trc.
Wed Jul 10 12:43:00 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13792.trc.
Wed Jul 10 12:44:54 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13792.trc.
Wed Jul 10 12:48:09 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13794.trc.
Wed Jul 10 12:57:01 CST 2013
Thread 1 advanced to log sequence 33866 (LGWR switch)
Current log# 3 seq# 33866 mem# 0: /u02/oradata/xezf/redo30.log
Current log# 3 seq# 33866 mem# 1: /u01/app/oracle/oradata/redo32.log
Wed Jul 10 12:57:03 CST 2013
ARC0: Standby redo logfile selected for thread 1 sequence 33865 for destination LOG_ARCHIVE_DEST_2
Wed Jul 10 12:57:09 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13782.trc.
Wed Jul 10 13:03:59 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13794.trc.
Wed Jul 10 13:08:55 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13780.trc.
Wed Jul 10 13:12:58 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13780.trc.
Wed Jul 10 13:16:06 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13782.trc.
Wed Jul 10 13:18:07 CST 2013
Thread 1 advanced to log sequence 33867 (LGWR switch)
Current log# 10 seq# 33867 mem# 0: /u02/oradata/xezf/redo10a.log
Current log# 10 seq# 33867 mem# 1: /u01/app/oracle/oradata/redo10b.log
Wed Jul 10 13:18:10 CST 2013
ARC0: Standby redo logfile selected for thread 1 sequence 33866 for destination LOG_ARCHIVE_DEST_2
Wed Jul 10 13:24:07 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13794.trc.
Wed Jul 10 13:36:59 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13794.trc.
Wed Jul 10 13:38:03 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13794.trc.
Wed Jul 10 13:40:58 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13780.trc.
Wed Jul 10 13:42:08 CST 2013
Thread 1 advanced to log sequence 33868 (LGWR switch)
Current log# 8 seq# 33868 mem# 0: /u01/app/oracle/oradata/redo81.log
Current log# 8 seq# 33868 mem# 1: /u02/oradata/xezf/redo80.log
Wed Jul 10 13:42:10 CST 2013
ARC0: Standby redo logfile selected for thread 1 sequence 33867 for destination LOG_ARCHIVE_DEST_2
Wed Jul 10 13:44:04 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13788.trc.
Wed Jul 10 13:53:11 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13782.trc.
Wed Jul 10 13:55:05 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13782.trc.
Wed Jul 10 13:57:07 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13786.trc.
Wed Jul 10 13:59:11 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13794.trc.
Wed Jul 10 14:01:07 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13782.trc.
Wed Jul 10 14:03:14 CST 2013
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/admin/xezf/udump/xezf_ora_13790.trc.

查看trc文件如下:

/u01/app/oracle/admin/xezf/udump/xezf_ora_13782.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 = /u01/app/oracle/product/10.2.0/db_1
System name: Linux
Node name: qs-xezf-db1
Release: 2.6.18-194.el5
Version: #1 SMP Tue Mar 16 21:52:39 EDT 2010
Machine: x86_64
Instance name: xezf
Redo thread mounted by this instance: 1
Oracle process number: 132
Unix process pid: 13782, image: oracle@qs-xezf-db1

*** 2013-07-10 12:57:09.184
*** ACTION NAME:() 2013-07-10 12:57:09.159
*** MODULE NAME:(JDBC Thin Client) 2013-07-10 12:57:09.159
*** SERVICE NAME:(SYS$USERS) 2013-07-10 12:57:09.159
*** SESSION ID:(870.2207) 2013-07-10 12:57:09.159
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)---------
Rows waited on:
Session 891: obj - rowid = 0000E6B1 - AAAOaxAAGAABL3mAAe
(dictionary objn - 59057, file - 6, block - 310758, slot - 30)
Session 870: obj - rowid = 0000E6B1 - AAAOaxAAGAABL3mAAA
(dictionary objn - 59057, file - 6, block - 310758, slot - 0)
Information on the OTHER waiting sessions:
Session 891:
sid: 891 ser: 9175 audsid: 23320314 user: 61/
flags: (0x100041) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
flags2: (0x8)
pid: 138 O/S info: user: oracle, term: UNKNOWN, ospid: 13792
image: oracle@qs-xezf-db1
O/S info: user: root, term: unknown, ospid: 1234, machine: qs-xept-app
program: JDBC Thin Client
application name: JDBC Thin Client, hash value=2546894660
----- PL/SQL Call Stack -----
object line object
handle number name
===================================================

 

 

根据trc信息,查询:

SQL> select addr,pid,spid,username,serial# from v$process t where t.PID in (132,138);

ADDR PID SPID USERNAME SERIAL#
---------------- ---------- ------------ --------------- ----------
000000019138CE88 13782 oracle 52
00000001983B5378 13792 oracle 6

 

SQL> select sid,serial#,paddr from v$session k where k.PADDR in ('000000019138CE88',
2 '00000001983B5378'
3 )
4 ;

SID SERIAL# PADDR
---------- ---------- ----------------
2207 000000019138CE88
9175 00000001983B5378

SQL>

 

根据 v$process 提供的spid 在操作系统层面查询:

 

[root@qs-xezf-db1 ~]# ps -ef |grep 13782
root 27059 5697 0 13:56 pts/3 00:00:00 grep 13782
[root@qs-xezf-db1 ~]# ps -ef |grep 13792
root 27065 5697 0 13:56 pts/3 00:00:00 grep 13792

 

由于上面的时间可以看出,在相同时间同时调用了两次,于是让开发的同事检查程序是否同时调用了两次,反馈信息确实如此,于是让他们更改之后,问题得以解决。


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • secureCRT下Linux终端汉字乱码解决方法
  • VS2005解决方案管理器中不显示解决方案节点的解决办法
  • 修改配置真正解决php文件上传大小限制问题(nginx+php)
  • 有高手能破解RAR的密码吗,至今没有找到人能解决?(先只给10分意思意思,若解决,至少给解决的人500分!说话算话!)
  • 修改配置真正解决php文件上传大小限制问题(apache+php)
  • 解决 select 挡住div的解决方法
  • window.onload事件覆盖掉body onload事件(window.onload和html body onload事件冲突)解决办法
  • 奇怪,怎么“已解决”问题只有4页(10/17日之后的),以前的已解决问题到哪里看?
  • sharepoint 2010中item.Update()和item.SystemUpdate 修改数据版本问题解决
  • 解决!解决!求助如何安装多系统!
  • andriod中UIScrollView无法正常滚动的解决方法
  • 解决多级索引速度慢的问题可否像解决多级页表那样使用TLB?
  • 错误:将'const x'作为'x'的'this'实参时丢弃了类型限定问题解决
  • Liunx命令tar压缩出现如下错误该怎么解决?急需解决!感谢
  • vs2010下禁用vmware的方法以及解决vmware插件导致vs2010变慢的问题
  • 求数据库解决方案===求数据库解决方案
  • windows server2008上PowerBuilder程序系统错误解决方法
  • MYSQL安装时解决要输入current root password的解决方法
  • Linux/CentOS下的CST和UTC时间的区别以及不一致的解决方法
  • 解决oracle用户连接失败的解决方法
  • 安装hadoop时出现内存不够及其它一些常见的hadoop错误解决办法
  • 呵呵,前段时间Ubuntu服务器版的问题总算解决了,解决方法就是重新安装桌面版-_-!


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,