1: 死锁:dead lock
alert中报警:
×××× ××××××
ORA-000060: Deadlock detected. More info in file /oraclelog/udump/qmcccx_ora_1049.trc
trace文件中有些解释,这里是提示应用问题:
×××××××××
DEADLOCK DETECTED
Current SQL statement for this session:
导致死锁的SQL语句
----- PL/SQL Call Stack -----
object line object
handle number name
3f2390028 126 procedure #¥◎
3f226b558 1 anonymous 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 waits process session holds waits
TX-00070081-000022ea 40 19 X 39 14 X
TX-00060080-000022d0 39 14 X 40 19 X
2:查锁定的对象
select object_id,session_id,locked_mode from v$locked_object;
select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1,v$session t2
where t1.session_id=t2.sid
order by t2.logon_time;
select t1.object_name,t2.session_id,t2.locked_mode
from dba_objects t1,v$locked_object t2
where t1.object_id=t2.object_id;
select t3.object_name,T3.object_type,t2.username,t2.sid,t2.serial#,
t2.logon_time
from dba_objects t3,v$locked_object t1,v$session t2
where t1.session_id=t2.sid
and t3.object_id=t1.object_id order by t2.logon_time;
确认的话,就可以
alter system kill session (sid,serial#);
把会话干掉
或者
kill -9