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

Oracle 杀死锁进程

时间:2018-10-19 14:00:45      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:rom   rac   _id   ssi   oracle   mod   nbsp   and   sid   

Oracle查询被锁的表:

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 order by b.logon_time;

查看连接的进程:

SELECT sid, serial#, username, osuser FROM v$session;

在系统上杀死进程:

先查出进程的sid号,然后根据SID号查出SPID(系统进程)

select spid, osuser, s.program  from v$session s,v$process p where s.paddr=p.addr and s.sid=24;

--杀掉进程 sid,serial#
alter system kill session‘210,11562‘;

涉及到的表:

SELECT * FROM v$lock;

SELECT * FROM v$sqlarea;

SELECT * FROM v$session;

SELECT * FROM v$process ;

SELECT * FROM v$locked_object;

SELECT * FROM all_objects;

SELECT * FROM v$session_wait;

Oracle 杀死锁进程

标签:rom   rac   _id   ssi   oracle   mod   nbsp   and   sid   

原文地址:https://www.cnblogs.com/yangyanhao/p/9815416.html

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