//ORACLE查询表死锁
select object_name,machine,s.sid,s.serial# from v$locked_object l,dba_objects o ,v$session s where l.object_id = o.object_id and l.session_id=s.sid; 2.下面的语句用来杀死一个进程: alter system kill session '24,111'; (其中24,111分别是上面查询出的sid,serial#)
//sqlserver判断表死锁和解锁
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 = 60 --锁表进程 declare @sql varchar(1000) set @sql='kill '+cast(@spid as varchar) exec(@sql)