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 @spid = 72 --锁表进程declare @sql varchar(1000)set @sql='kill '+cast(@spid as varchar)exec(@sql)…
--查看锁表: 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 @spid = 57 --锁表进程 declare @sql varchar(1000) set @sql='kill '+cast(@spid as va…
原文:sqlserver 出现sql被锁时,查看加锁和被锁的sql DECLARE @spid INT DECLARE @blk INT DECLARE @count INT DECLARE @index INT DECLARE @lock TINYINT SET @lock=0 CREATE TABLE #temp_who_lock ( id INT IDENTITY(1, 1), spid INT, blk INT ) --if @@e…
查看锁表进程SQL语句 set pagesize 999 set line180 col ORACLE_USERNAME for a18 col OS_USER_NAME for a18 col OBJECT_NAME for a24 select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.object_name, lo.locked_mode from v…