--查询死锁 select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.object_name, lo.locked_mode from v$locked_object lo, dba_objects ao,v$session sess where ao.object_id = lo.object_id and lo.session_id = sess.sid; --oracle级别kill session alter system kill session '1627,1'; alter system kill session '1564,64740'; --查询当前连接会话 select s.value,s.sid,a.username,a.MACHINE from v$sesstat S,v$statname N,v$session A where n.statistic#=s.statistic# and name='session pga memory' and s.sid=a.sid and a.sid=1626 order by s.value; --查询造成死锁的sql语句 SELECT a.SID, a.username, s.sql_text FROM v$session a, v$sqltext s WHERE a.sql_address = s.address AND a.sql_hash_value = s.hash_value and a.SID=1626 ORDER BY a.username, a.SID, s.piece; --造成锁等待的操作内容 begin flt_com.p_line_relation_change(:A0,:B0,:C0,:D0,:E0,:ret_errorcode,:ret_errorname); end; --通过sid查找pid,进而通过系统级别kill select spid, osuser, s.program from v$session s,v$process p where s.paddr=p.addr and s.sid=1605; --服务器级别kill kill -9 spid --------------------------------over game |