如何找出页面锁所属的表 [英] How to find out what table a page lock belongs to

查看:37
本文介绍了如何找出页面锁所属的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们遇到性能问题时,我正在使用sys.dm_tran_locks视图检查数据库的哪些区域有锁.

I'm using the sys.dm_tran_locks view to check what areas of my database have locks when we are having performance problems.

使用此视图....

  • 如果resource_type是 database ,我可以使用DB_NAME函数来查找具有锁定功能的数据库.

  • If the resource_type is database I can use the DB_NAME function to find out what database has the lock.

如果它是一个对象,我通常可以加入sys.tables来检查它是什么表.

If its an object I can normally join to sys.tables to check what table it is.

但是,如果resource_type是 Page Key ,有什么方法可以将其追溯到其父表,这样我就可以很好地了解哪些表已锁定?

However if the resource_type is Page or Key is there any way to trace this back to its parent table so I can get a good idea of which tables are locking?

推荐答案

这是resource_associated_entity_id列的用途( 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆