为了得到我的具体问题的答案,我希望使用这个问题作为一个维基,每个锁是什么意思,以及在什么情况下将获得这种类型的锁.
>共享(S)
>更新(U)
>独家(X)
意图
意图共享(IS)
意图排除(IX)
>与意图专有共享(SIX)
意图更新(IU)
>更新意图独占(UIX)
>共享意图更新(SIU)
>模式
模式修改(Sch-M)
模式稳定性(Sch-S)
>批量更新(BU)
>关键范围
>共享密钥范围和共享资源锁(RangeS_S)
>共享密钥范围和更新资源锁(RangeS_U)
>插入键范围和空资源锁(RangeI_N)
>独占键范围和独占资源锁(RangeX_X)
>转换锁(RangeI_S,RangeI_U,RangeI_X,RangeX_S,RangeX_U)
解决方法
An intent lock indicates that sql Server wants to acquire a shared (S) lock or exclusive (X) lock on some of the resources lower down in the hierarchy. For example,a shared intent lock placed at the table level means that a transaction intends on placing shared (S) locks on pages or rows within that table. Setting an intent lock at the table level prevents another transaction from subsequently acquiring an exclusive (X) lock on the table containing that page. Intent locks improve performance because sql Server examines intent locks only at the table level to determine if a transaction can safely acquire a lock on that table. This removes the requirement to examine every row or page lock on the table to determine if a transaction can lock the entire table.