sql 持有锁的申请

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 持有锁的申请相关的知识,希望对你有一定的参考价值。

select APPLICATION_HANDLE FROM TABLE(MON_GET_UNIT_OF_WORK(NULL,-1)) where UOW_START_TIME < CURRENT TIMESTAMP - 12 HOURS and NUM_LOCKS_HELD > 0 and workload_occurrence_state = 'UOWWAIT'
select a.APPLICATION_HANDLE
,timestampdiff ( 4, varchar(timestamp(current timestamp) - timestamp(a.UOW_START_TIME)) ) as duration_minutes
--,substr(b.STMT_TEXT,1,200) as stmt_text
FROM TABLE(MON_GET_UNIT_OF_WORK(NULL,-1)) a
left join sysibmadm.LONG_RUNNING_SQL AS b on (a.APPLICATION_HANDLE = b.agent_id)
where a.UOW_START_TIME < CURRENT TIMESTAMP - 4 HOURS and a.NUM_LOCKS_HELD > 0 and a.workload_occurrence_state = 'UOWWAIT'

以上是关于sql 持有锁的申请的主要内容,如果未能解决你的问题,请参考以下文章

SQL Server中锁与事务隔离级别

追踪SQL Server执行delete操作时候锁的申请与释放过程

SQL 锁的使用

确定持有文件锁的线程

是否可以确定持有互斥锁的线程?

Java:线程在没有获取锁的情况下持有锁