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.session_id = b.sid order by b.logon_time

3.杀掉进程

alter system kill session ‘sid,serial#‘;

原文地址:https://www.cnblogs.com/LoveShare/p/11502726.html

时间: 2024-10-11 01:16:59

Oracle查看锁表和解锁的相关文章

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的锁表与解锁

Oracle的锁表与解锁 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

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.

MsSqlserver 查看锁表与解锁

查看被锁表: select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type='OBJECT' spid 锁表进程 tableName 被锁表名 解锁: declare @spid int Set @spid = 57 --锁表进程 declare @sql varchar(1000) set @sql='k

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

pl/sql查看锁表及解锁

① 查看用户锁表 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 ② 解锁语句 alter system kil

Oracle查询锁表和解锁

1.查询是否锁表 SELECT l.session_id sid, s.serial#, l.locked_mode,l.oracle_username, l.os_user_name,s.machine, s.terminal, o.object_name, s.logon_time FROM v$locked_object l, all_objects o, v$session s WHERE l.object_id = o.object_id AND l.session_id = s.si