查找用于停滞的sp_getapplock调用的resource_name
我是使用SP_GETAPPLOCK存储过程调用来执行一些特定funcitonation的应用程序的DBA。有时,出于某些未知原因,也许是应用程序错误,gremlins或其他未知错误,锁不会释放。我可以通过查看应用程序DB来编程确定这些锁是否处于冷冻状态。我想在某些情况下调用sp_releaseaplock释放锁定,但是我无法弄清楚相应的sp_getapplock呼叫中使用的相关资源_name在系统DMV中存储的位置。
由于该应用程序每次称为随机资源名称,因此我无法将SP_Releaseleack调用进行编码。如何通过DMVS确定与sys.dm_tran_locks表中的条目关联的Resource_name?
I am the DBA for an application that uses the sp_getapplock stored procedure call to perform some specific funcitonality. Occasionally, for some unknown reason, perhaps application bug, gremlins, or other unknown error, the lock is not released. I can programmatically determine whether one of these locks is in a frozen state by looking in the application DB. I would like to call sp_releaseapplock to free the lock under certain circumstances, but I cannot figure out where the associated resource_name used in the corresponding sp_getapplock call is stored in the system DMVs.
Since the application uses a random resource name each time it is called, I cannot hardcode the sp_releaselock call. How do I determine through the DMVs the resource_name associated with an entry in the sys.dm_tran_locks table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论