1. 首先使用dba用戶登錄oracle庫
2. Oracle查詢被鎖的表:
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.object_id;
3. 查看那個用戶簿废,那個進程造成的死鎖
select b.username,b.sid,b.serial#,logon_time from v$locked_object
a,v$session b where a.session_id = b.sid order by b.logon_time;
查看連接的進程:
SELECT sid, serial#, username, osuser FROM v$session;
在系統(tǒng)上殺死進程:
先查出進程的sid號蚯根,然后根據(jù)SID號查出SPID(系統(tǒng)進程)
select spid, osuser, s.program ?from v$session s,v$process p where s.paddr=p.addr and s.sid=24;
4. 殺掉進程 sid,serial#
alter system kill session 'sid,serial#';
例如:
alter system kill session'1608,21221';