码迷,mamicode.com
首页 > 数据库 > 详细

oracle查看被锁的表和被锁的进程,杀掉进程

时间:2014-06-14 12:55:33      阅读:256      评论:0      收藏:0      [点我收藏+]

标签:oracle   sql   

-- 1. 查看被锁的表
SELECT p.spid, a.serial#, c.object_name, b.session_id, b.oracle_username,b.os_user_name
FROM v$process p, v$session a, v$locked_object b, all_objects c
WHERE p.addr = a.paddr
AND a.process = b.process
AND c.object_id = b.object_id

-- 2. 查看是哪个进程锁的
SELECT sid, serial#, username, status, osuser FROM v$session  where serial# = ‘5002‘

SELECT sid, serial#, username, status, osuser FROM v$session  where serial# = ‘3789‘

 

-- 3. 杀掉这个进程 
alter system kill session ‘sid,serial#‘;

alter system kill session ‘269,3789‘;

alter system kill session ‘34,4661‘;

alter system kill session ‘265,5002‘;
alter system kill session ‘289,1688‘;
alter system kill session ‘282,5799‘;

oracle查看被锁的表和被锁的进程,杀掉进程,布布扣,bubuko.com

oracle查看被锁的表和被锁的进程,杀掉进程

标签:oracle   sql   

原文地址:http://blog.csdn.net/qq345425170/article/details/30494931

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