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

Oracle锁表处理操作笔记

时间:2017-06-20 17:56:09      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:Owner   语句   oracle锁   数据库   name   ssi   dba   pre   blog   

--查看锁表进程SQL语句1:

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;

或者

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;

---查看锁表进程SQL语句2:

SELECT *
  FROM v$session t1, v$locked_object t2
 WHERE t1.sid = t2.SESSION_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,serial#

ALTER SYSTEM KILL SESSION sid,serial;

 

Oracle锁表处理操作笔记

标签:Owner   语句   oracle锁   数据库   name   ssi   dba   pre   blog   

原文地址:http://www.cnblogs.com/beyondzw/p/7054769.html

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