记录今天遇见的oracle ora-00060死锁问题
2010-08-26 18:35
561 查看
今天一个系统oracle数据库老是报死锁问题,可以看出:
Thu Aug 26 15:57:11 2010
ORA-00060: Deadlock detected. More info in file /opt/app/oracle/admin/TMNEWOSS/udump/tmnewoss_ora_225.trc.
Thu Aug 26 16:00:27 2010
ORA-00060: Deadlock detected. More info in file /opt/app/oracle/admin/TMNEWOSS/udump/tmnewoss_ora_812.trc.
每隔一段时间就不停地报错,首先我们应该明确产生死锁的原因:
当两个或更多用户相互等待锁定的数据时就会发生死锁,发生死锁时,这些用户被卡住不能继续处理业务,Oracle自动检测死锁并解决它们(通过回滚一个包含在死锁中的语句实现),释放掉该语句锁住的数据,回滚的会话将会遇到Oracle错误“ORA-00060:等待资源时检测到死锁”。
那么这个问题处理就很容易了,程序设计逻辑上有些问题,因为oracle 10g检测和解除死锁的功能,并生成trace文件,那么我们可以找到生成的文件,里面有详细的错误,将发生问题的会话修改提交或回滚即可,如本次可以找到如下信息:
/opt/app/oracle/admin/TMNEWOSS/udump/tmnewoss_ora_225.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /opt/app/oracle/product/10.2.0
System name: SunOS
Node name: tmossstandby
Release: 5.10
Version: Generic_138888-03
Machine: sun4u
Instance name: TMNEWOSS
Redo thread mounted by this instance: 1
Oracle process number: 419
Unix process pid: 225, image: oracle@tmossstandby
*** 2010-08-26 15:57:11.288
*** SERVICE NAME:(SYS$USERS) 2010-08-26 15:57:11.248
*** SESSION ID:(561.4685) 2010-08-26 15:57:11.248
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
TX-00170025-0001f763 419 561 X 408 126 S
TX-00010004-0006102f 408 126 X 419 561 X
session 561: DID 0001-01A3-0008D5C0 session 126: DID 0001-0198-0011E9FB
session 126: DID 0001-0198-0011E9FB session 561: DID 0001-01A3-0008D5C0
Rows waited on:
Session 126: no row
Session 561: obj - rowid = 0000F909 - AAAPkJAANAAAAcxAAG
(dictionary objn - 63753, file - 13, block - 1841, slot - 6)
Information on the OTHER waiting sessions:
Session 126:
pid=408 serial=34132 audsid=48552656 user: 101/TMOSSALARM
O/S info: user: , term: , ospid: 1234, machine: tmossapp
program:
Current SQL Statement:
delete from ALARMINFO where ALARMNUMBER=:1
End of information on OTHER waiting sessions.
Current SQL statement for this session:
update ALARMINFO set ADAPTERNAME=:1, ALARMCAUSE=:2, CLEARABLE=:3, ISCLEARED=:4, INSERTTIME=:5, ALARMLEVEL=:6, PROBABLECAUSE=:7, source=:8, ALARMOBJECT=:9, OBJCLASS=:10, ALARMTYPE=:11, ISACKED=:12, ACKTIME=:13, ACKPERSON=:14, CLEARTIME=:15, CLEARPERSON=:16, COMPRESSED=:17, ALARMCOUNTER=:18, faultBillStatus=:19, ASSIGNPERSON=:20, ASSIGNTIME=:21, STARTTIME=:22, LASTSTARTTIME=:23, ORIGINAL_LEVEL=:24, ORIGINAL_TYPE=:25, REDEFINED=:26, UPGRADED=:27, USERREMARK=:28, starredUserForDao=:29, speciality=:30, originalCause=:31, sourceName=:32, neId=:33, neName=:34, neType=:35, vendorId=:36, TERRITORY_ID=:37, FINGERPRINT=:38, RELATEDALARMS=:39, STATIONCODE=:40, ACTIVEDURATION=:41, REMARKTIME=:42, STATIONNAME=:43, DISTRICTNAME=:44, clearAlarmText=:45, ALARMCAUSEID=:46, FAULTRULEID=:47, FAULTCLASSID=:48, middleObjectId=:49, smallObjectId=:50, middleObjectName=:51, smallObjectName=:52, neGroup=:53, middleObjectType=:54, smallObjectType=:55, additionalInfo=:56, notificationId=:57 where ALARMNUMBER=:58
===================================================
PROCESS STATE
-------------
Process global information:
process: 4b851f980, call: 407057f98, xact: 4b5670a38, curses: 4b86e5800, usrses: 4b86e5800
----------------------------------------
SO: 4b851f980, type: 2, owner: 0, flag: INIT/-/-/0x00
(process) Oracle pid=419, calls cur/top: 407057f98/407057f98, flag: (0) -
int error: 0, call error: 0, sess error: 0, txn error 0
(post info) last post received: 109 0 4
last post received-location: kslpsr
last process to post me: 4b84ba4b8 2 6
last post sent: 0 0 24
last post sent-location: ksasnd
last process posted by me: 4b84ba4b8 2 6
(latch info) wait_event=0 bits=0
Process Group: DEFAULT, pseudo proc: 4b8566a38
O/S info: user: oracle, term: UNKNOWN, ospid: 225
OSD pid info: Unix process pid: 225, image: oracle@tmossstandby
我们可以很清楚的找到问题的原因和根本,很简单,检查程序中的语句,使其执行后提交即可。
附件:http://down.51cto.com/data/2356613
Thu Aug 26 15:57:11 2010
ORA-00060: Deadlock detected. More info in file /opt/app/oracle/admin/TMNEWOSS/udump/tmnewoss_ora_225.trc.
Thu Aug 26 16:00:27 2010
ORA-00060: Deadlock detected. More info in file /opt/app/oracle/admin/TMNEWOSS/udump/tmnewoss_ora_812.trc.
每隔一段时间就不停地报错,首先我们应该明确产生死锁的原因:
当两个或更多用户相互等待锁定的数据时就会发生死锁,发生死锁时,这些用户被卡住不能继续处理业务,Oracle自动检测死锁并解决它们(通过回滚一个包含在死锁中的语句实现),释放掉该语句锁住的数据,回滚的会话将会遇到Oracle错误“ORA-00060:等待资源时检测到死锁”。
那么这个问题处理就很容易了,程序设计逻辑上有些问题,因为oracle 10g检测和解除死锁的功能,并生成trace文件,那么我们可以找到生成的文件,里面有详细的错误,将发生问题的会话修改提交或回滚即可,如本次可以找到如下信息:
/opt/app/oracle/admin/TMNEWOSS/udump/tmnewoss_ora_225.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /opt/app/oracle/product/10.2.0
System name: SunOS
Node name: tmossstandby
Release: 5.10
Version: Generic_138888-03
Machine: sun4u
Instance name: TMNEWOSS
Redo thread mounted by this instance: 1
Oracle process number: 419
Unix process pid: 225, image: oracle@tmossstandby
*** 2010-08-26 15:57:11.288
*** SERVICE NAME:(SYS$USERS) 2010-08-26 15:57:11.248
*** SESSION ID:(561.4685) 2010-08-26 15:57:11.248
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
TX-00170025-0001f763 419 561 X 408 126 S
TX-00010004-0006102f 408 126 X 419 561 X
session 561: DID 0001-01A3-0008D5C0 session 126: DID 0001-0198-0011E9FB
session 126: DID 0001-0198-0011E9FB session 561: DID 0001-01A3-0008D5C0
Rows waited on:
Session 126: no row
Session 561: obj - rowid = 0000F909 - AAAPkJAANAAAAcxAAG
(dictionary objn - 63753, file - 13, block - 1841, slot - 6)
Information on the OTHER waiting sessions:
Session 126:
pid=408 serial=34132 audsid=48552656 user: 101/TMOSSALARM
O/S info: user: , term: , ospid: 1234, machine: tmossapp
program:
Current SQL Statement:
delete from ALARMINFO where ALARMNUMBER=:1
End of information on OTHER waiting sessions.
Current SQL statement for this session:
update ALARMINFO set ADAPTERNAME=:1, ALARMCAUSE=:2, CLEARABLE=:3, ISCLEARED=:4, INSERTTIME=:5, ALARMLEVEL=:6, PROBABLECAUSE=:7, source=:8, ALARMOBJECT=:9, OBJCLASS=:10, ALARMTYPE=:11, ISACKED=:12, ACKTIME=:13, ACKPERSON=:14, CLEARTIME=:15, CLEARPERSON=:16, COMPRESSED=:17, ALARMCOUNTER=:18, faultBillStatus=:19, ASSIGNPERSON=:20, ASSIGNTIME=:21, STARTTIME=:22, LASTSTARTTIME=:23, ORIGINAL_LEVEL=:24, ORIGINAL_TYPE=:25, REDEFINED=:26, UPGRADED=:27, USERREMARK=:28, starredUserForDao=:29, speciality=:30, originalCause=:31, sourceName=:32, neId=:33, neName=:34, neType=:35, vendorId=:36, TERRITORY_ID=:37, FINGERPRINT=:38, RELATEDALARMS=:39, STATIONCODE=:40, ACTIVEDURATION=:41, REMARKTIME=:42, STATIONNAME=:43, DISTRICTNAME=:44, clearAlarmText=:45, ALARMCAUSEID=:46, FAULTRULEID=:47, FAULTCLASSID=:48, middleObjectId=:49, smallObjectId=:50, middleObjectName=:51, smallObjectName=:52, neGroup=:53, middleObjectType=:54, smallObjectType=:55, additionalInfo=:56, notificationId=:57 where ALARMNUMBER=:58
===================================================
PROCESS STATE
-------------
Process global information:
process: 4b851f980, call: 407057f98, xact: 4b5670a38, curses: 4b86e5800, usrses: 4b86e5800
----------------------------------------
SO: 4b851f980, type: 2, owner: 0, flag: INIT/-/-/0x00
(process) Oracle pid=419, calls cur/top: 407057f98/407057f98, flag: (0) -
int error: 0, call error: 0, sess error: 0, txn error 0
(post info) last post received: 109 0 4
last post received-location: kslpsr
last process to post me: 4b84ba4b8 2 6
last post sent: 0 0 24
last post sent-location: ksasnd
last process posted by me: 4b84ba4b8 2 6
(latch info) wait_event=0 bits=0
Process Group: DEFAULT, pseudo proc: 4b8566a38
O/S info: user: oracle, term: UNKNOWN, ospid: 225
OSD pid info: Unix process pid: 225, image: oracle@tmossstandby
我们可以很清楚的找到问题的原因和根本,很简单,检查程序中的语句,使其执行后提交即可。
附件:http://down.51cto.com/data/2356613
相关文章推荐
- 遇见问题记录-oracle表,行死锁
- Oracle自动导入数据文件(类似bcp的功能)及问题记录SQL*LOADER-704,ORA-12504
- ORACLE STANDBY 修复ORA-19505问题记录
- Oracle登录报ORA-01031: insufficient privileges的问题记录
- ORACLE11.2.0.4 版本升级ORA-39700: database must be opened with UPGRADE option问题解决记录
- 时隔很久,要重新开始编程。今天试了下从头开始在ORACLE中建用户记录下遇到的问题,以备将来可查。
- oracle遇见问题记录
- 【oracle】有关 ORA-00600: internal error code, arguments: [kkqcscpopn_Int: 0] 错误,问题记录
- 关于“ORA-00060:等待资源时检测到死锁”问题的分析
- Oracle问题解决记录:报错信息为-ORA-12505: TNS: 监听程序当前无法识别连接描述符中所给出的 SID
- 主外键造成ORA-00060死锁问题的解决方案
- 关于oracle死锁问题——ORA-01436: 用户数据中的 CONNECT BY 循环
- 今天在学习物化视图时,遇到了ORA-12034问题
- Oracle中的几个问题记录
- Oracle TnsName问题记录
- dll 和 template(cegui中遇见的小问题,对解决任何问题没有任何帮助,仅记录)
- 今天开始学习Oracle 10g,遇到的问题。
- Oracle 11g 导出数据报 “ORA-01455: 转换列溢出整数数据类型”的问题
- oracle ORA-01000: maximum open cursors exceeded问题的解决方法
- Ora-03113\Ora-03114与Oracle In 拼接字符串的问题