oracle有锁的处理步骤
1、 查看哪些程序和session有锁
select C.sid,C.serial#,B.object_name,C.username,C.machine,C.terminal,C.program from Gv$locked_object A,all_objects B,Gv$session C where A.session_id = C.sid
and A.object_id = B.object_id;
2、查看引起锁的是哪个session和具体的程序名和机器名称
select C.sid,C.serial#,C.username,C.machine,C.terminal,C.program from dba_waiters A,v$session C where A.holding_session = C.sid
杀掉session
alter system kill session ‘159,17622';
如果杀不掉,需要在操作系统上杀掉
select * from v$process 找到session对应的进程
kill -9 进程id
select C.sid,C.serial#,C.username,C.machine,C.terminal,C.program,B.SQL_TEXT
from dba_waiters A,V$SQL B,v$session C where A.WAITING_session = C.sid AND B.SQL_ID=C.SQL_ID