Oracle数据库表解锁语句

时间:2021-11-26 21:35:36

--表解锁
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 '383,63821';

----表解锁---
select sess.sid,
sess.serial#,
lo.oracle_username,
lo.os_user_name,
ao.object_name,
lo.locked_mode
from Gv$locked_object lo,
dba_objects ao,
Gv$session sess
where ao.object_id = lo.object_id and lo.session_id = sess.sid;

alter system kill session '242,749';

或者:

select sid,serial#,sql_text,executions from v$sql join v$session on v$sql.sql_id=v$session.sql_id where cpu_time>20000

alter system kill session '155,23910'