Oracle表解锁[@more@]
查询被锁的表:
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;
解锁:
alter system kill session '179,4276';
注意最后面的参数结构为:'sid,serial'
如果上面的方法不行,就只能杀操作进程了:
查询session对应的进程
SELECT sid, username, paddr, status FROM v$session WHERE username = 'JCUSER' and sid=上面查出来的sid;
SELECT ADDR,PID,SPID,USERNAME,SERIAL#,TERMINAL FROM v$process WHERE addr = '上面的PADDR';
杀掉spid所标识的那个进程
orakill sid spid