oracle 查看锁表情况与解表

oracle 查看锁表情况与解表

CreateTime--2018年4月27日17:24:37

Author:Marydon

1.锁表查询

--锁表查询
SELECT OBJECT_NAME AS TABLE_NAME, MACHINE, S.SID, S.SERIAL#
  FROM GV$LOCKED_OBJECT L, DBA_OBJECTS O, GV$SESSION S
 WHERE L.OBJECT_ID  = O.OBJECT_ID
   AND L.SESSION_ID = S.SID;

2.解表

--释放SESSION SQL
--ALTER SYSTEM KILL SESSION ‘sid, serial‘;
ALTER SYSTEM KILL SESSION ‘1916, 19637‘;

3.效果展示

相关推荐:

  • 类似文章

原文地址:https://www.cnblogs.com/Marydon20170307/p/8963586.html

时间: 2024-10-29 19:07:58

oracle 查看锁表情况与解表的相关文章

oracle查看锁表进程,杀掉锁表进程

查看锁表进程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_

Oracle查看锁表

查看锁表进程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_

Oracle 查看锁表进程_杀掉锁表进程 [转]

查看锁表进程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; 查看锁表进程SQL语句2: sel

Oracle 查看锁情况

/*查看锁(lock)情况*/ SELECT ls.osuser os_user_name, ls.username user_name, decode(ls.type, 'RW', 'Row wait enqueue lock', 'TM', 'DML enqueue lock', 'TX', 'Transaction enqueue lock', 'UL', 'User supplied lock') lock_type, o.object_name OBJECT, decode(ls.lm

oracle 查看锁表情况并处理锁表

/* *locked *query locked object and analyse reason,kill it * */ select 'alter system kill session ''' || SID || ',' || SERIAL# || ''';' from (select distinct a.sid, a.Serial#, status, machine, LOCKWAIT, logon_time from v$session a, v$locked_object b

oracle,查看锁表

(1)锁表查询的代码有以下的形式:select count(*) from v$locked_object;select * from v$locked_object;(2)查看哪个表被锁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;(3)查看是哪个session引起的select b.user

Oracle查看锁表和解锁

--注意权限问题 1.查看是否有被锁的表: 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 2.查看是哪个进程锁的 select b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b where a.ses

Oracle查看锁表与解锁方法

--查看 select a.object_name,b.session_id,c.serial#,c.program,c.username,c.command,c.machine,c.lockwait from all_objects a,v$locked_object b,v$session c where a.object_id=b.object_id and c.sid=b.session_id; --解锁 alter system kill session'session_id,seri

Oracle未开启审计情况下追踪表变更记录

运维组的老大打电话说,他们发现有几万笔业务被重新推送了一遍,而且是第三次了,问题还是挺严重的,想要追踪是谁做的误操作,他们有时间段和涉及的表,问有没有办法追踪到. 数据库版本为10.2.0.4.首先想到的是审计功能,但是无奈数据库没有开审计.再次想到的是日志挖掘(LogMiner),但是不确定能不能找到对应操作的用户和主机.在QQ群里提出了这个问题,得到的答案是可以找到,同时也在官方文档中找到了v$logmnr_contents中对就的SESSION_INFO字段: 从上面给出的信息可以看出,可