码迷,mamicode.com
首页 > 其他好文 > 详细

锁(下)

时间:2014-10-17 10:24:36      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:dba   oracle   select   kill   sql   

(2)解锁方法
alter system kill session ‘878,1773‘;    /*878为SID,1773为SERIAL#*/


select /*+ rule */ s.username,
     decode(l.type,‘tm‘,‘table lock‘,‘tx‘,‘row lock‘,null) lock_level,
      o.owner,o.object_name,o.object_type,
      s.sid,s.serial#,s.terminal,s.machine,s.program,s.osuser
from v$session s,v$lock l,dba_objects o
where l.sid = s.sid
and l.id1 = o.object_id(+)
and s.osuser = ‘okf55657‘ and s.username = ‘lbimk_babilon‘
and s.username is not null

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;

select b.username,b.sid,b.serial#,logon_time   from v$locked_object a,v$session b   where a.session_id = b.sid
and a.session_id = 745;

alter system kill session‘767,19132‘;


select a.sid,a.serial#,c.object_name,a.sql_id
from v$session a,v$locked_object b,all_objects c
where a.sid=b.session_id
and b.object_id=c.object_id;

select spid from v$process
where addr = (
select paddr from v$session where sid = 767
);

找到对应的spid后,在后台用命令kill -9 spid杀掉OS进程。

锁(下)

标签:dba   oracle   select   kill   sql   

原文地址:http://blog.csdn.net/jenya007/article/details/40180615

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!