jingshen 发表于 2016-11-16 06:09:28

DB2 和 SQLserver查询锁的表及解锁

DB2:
SELECT agent_id,table_name FROM TABLE (SNAPSHOT_LOCK('EBANK',-1)) AS LOCK where table_name is not null

FORCE APPLICATION(agent_id);

SQLServer:
select request_session_id spid,
   OBJECT_NAME(resource_associated_entity_id)tableName
from sys.dm_tran_locks
where resource_type = 'OBJECT '
kill spid
页: [1]
查看完整版本: DB2 和 SQLserver查询锁的表及解锁