查看oracle被锁的表】的更多相关文章

注意权限问题 1.查看是否有被锁的表: select b.owner,b.object_name,a.session_id,a.locked_modefrom v$locked_object a,dba_objects b where b.object_id = a.object_id 2.查看是哪个进程锁的 select b.username,b.sid,b.serial#,logon_timefrom v$locked_object a,v$session b where a.session…
SELECT /*+ rule*/ a.sid, b.owner, object_name, object_type FROM v$lock a, all_objects b WHERE TYPE = 'TM' and a.id1 = b.object_id; 查到的都是被锁的表 SELECT * FROM v$session where sid = xxx; 查到 serial# 最后alter system kill session 'sid,serial#';  关闭锁…
--Oracle数据库操作中,我们有时会用到锁表查询以及解锁和kill进程等操作,那么这些操作是怎么实现的呢?本文我们主要就介绍一下这部分内容. --(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_objec…
Oracle数据库操作中,我们有时会用到锁表查询以及解锁和kill进程等操作,那么这些操作是怎么实现的呢?本文我们主要就介绍一下这部分内容.(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…
查看被锁表: 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 @sql='kill '+cast(@spid as varchar) exec(@s…
select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type='OBJECT' declare @spid int --锁表进程 ) set @sql='kill '+cast(@spid as varchar) exec(@sql) 转自: http://www.cnblogs.com/chjf2008/…
-- 查看数据库锁明细 select a.sid, b.serial#, b.username, b.osuser, b.machine, b.program, c.object_name,d.spid, decode(a.type, 'mr', 'media recovery', 'rt','redo thread', 'un','user name', 'tx', 'transaction', 'tm', 'dml', 'ul', 'pl/sql user lock', 'dx', 'dis…
-- 查看ORACLE 数据库中本用户下的所有表 SELECT table_name FROM user_tables; -- 查看ORACLE 数据库中所有用户下的所有表 select user,table_name from all_tables; -- 查看ORACLE 数据库中本用户下的所有列 select table_name,column_name from user_tab_columns; -- 查看ORACLE 数据库中本用户下的所有列 select user,table_na…
查看sqlserver被锁的表以及如何解锁   查看被锁表: 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  = 5…
锁表处理及查询 查看Oracle数据库被锁住的表,删除锁表的进程 1.查看被锁住的表 SELECT dob.object_name table_name,    lo.locked_mode, lo.session_id, vss.serial#, vss.action action, vss.osuser osuser, vss.logon_time, vss.process ap_pid, vps.spid db_pid FROM v$locked_object lo, dba_object…