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

猜你喜欢

转载自wanghuanqiu.iteye.com/blog/1501463