1.查询被锁的会话ID: select session_id from v$locked_object;查询结果:SESSION_ID-------92.查询上面会话的详细信息: SELECT sid, serial#, username, osuser FROM v$session where sid = 9; 3.将上面锁定的会话关闭: ALTER SYSTEM KILL SESSION '9,99';
打开sql plus select session_id from v$locked_object;查询出oracle锁定的会话ID SELECT sid, serial#, username, osuser FROM v$session where sid = 1; 查询出当前会话数的信息 ALTER SYSTEM KILL SESSION '200,2141'; 杀掉当前会话 注:'200,2141'是:SID和SERIAL字段进行拼接的
SELECT sid, serial#, username, osuser FROM v$session where sid in(select session_id from v$locked_object); --kill掉相关的会话 ALTER SYSTEM KILL SESSION '597,1171';
select l.session_id,o.owner,o.object_name from v$locked_object l,dba_objects o where l.object_id=o.object_id; select t2.username,t2.sid,t2.serial#,t2.logon_time from v$locked_object t1,v$session t2 ,,,,,,,) order by t2.logon_time;
查询所有会话 select t2.username, t2.sid, t2.serial#, t2.logon_time from v$locked_object t1, v$session t2 where t1.session_id = t2.sid order by t2.logon_time; 强行结束会话 alter system kill session 'sid,serial';
--ORA-00054:资源正忙,要求指定NOWAIT-- --以DBA角色, 查看当前数据库里锁的情况可以用如下SQL语句-- SELECT sid, serial#, username, osuser FROM v$session WHERE sid IN(SELECT session_id FROM v$locked_object); --杀掉锁-- ALTER SYSTEM KILL SESSION 'sid,serial#'; ALTER SYSTEM KILL SESSION '15
Oracle解锁,解决“ora00054:资源正忙”错误 一.处理步骤:--1.获取被锁对象的session_idSELECT session_id FROM v$locked_object; --2.通过session_id获取v$session的sid和serial#SELECT sid, serial#, username, osuser FROM v$session where sid = session_id; --3.终止相关进程.ALTER SYSTEM KILL SESSION