Thursday, December 1, 2016
Resource level locks in Sql Server
- Row
- Key
- Table
- Page
- Extent
- Partition
- Database
- Shared Lock(S) - Can be held by any processes
- Update Lock(U) - Mix of shared and exclusive lock
- Exclusive Lock(X) - Can be held by only one process
- Intent Lock(I)
- Intent Shared(IS)
- Shared with Intent Exclusive(SIX)
- Intent Exclusive(IX)
- Bulk Update Lock(BU)
- Schema Lock
- Schema Stability (Sch-S) - It is applied while generating the execution plan
- Schema Modification (Sch-M) - It is applied while executing a DDL Statement
- Pessimistic
- Read Uncommitted (NOLOCK) - No shared lock acquired
- Read Committed (READCOMMITTED) (Default) - Shared lock acquired and released immediately
- Repeatable Read (REPEATABLEREAD) - Lock till the end of transaction
- Serialization (HOLDLOCK) - Lock till the end of transaction and a range of rows
-
Optimistic
- Snapshot
- Snapshot Read Committed
- sys.dm_tran_locks view keeps track of a Lock and resource identification
- sys.dm_exec_sessions view provides transaction isolation level in use for the current process
Subscribe to:
Posts (Atom)