Al's BrainDump

RSS

Navigation





Quick Search
»
Advanced Search »

PoweredBy

Deadlocks

Resolve by
  • Change code to trap SQL Server 1205 errors and resubmit the request. A 1205 error means the request was chosen as a deadlock victim, and a try/catch can resubmit without the user ever being aware of it.
  • After you enable the 1204 and 1222 trace flags and determine which indexes are getting deadlocked, you can often eliminate deadlocks by adding an index, changing an index, or every once in a while by deleting an index
  • Turn off parallel operations. If parallel operations are possible (the server has multiple processors/cores) and allowed, it's possible that turning it off (by setting MaxDOP to 1) will reduce or eliminate deadlocking
  • Enable page-level and row-level locking. Page and row locking are allowed by default, but if someone's turned them off, you might need to consider turning them back on




Locks

http://www.mssqlcity.com/Articles/General/sql2000_locking.htm

  1. Shared (S)
  2. Update (U)
  3. Exclusive (X)
  4. Intent

  • intent shared (IS)
  • intent exclusive (IX)
  • shared with intent exclusive (SIX)
  • intent update (IU)
  • update intent exclusive (UIX)
  • shared intent update (SIU)

  1. Schema

  • schema modification (Sch-M)
  • schema stability (Sch-S)

  1. Bulk Update (BU)
  2. Key-Range

  • Shared Key-Range and Shared Resource lock (RangeS_S)
  • Shared Key-Range and Update Resource lock (RangeS_U)
  • Insert Key-Range and Null Resource lock (RangeI_N)
  • Exclusive Key-Range and Exclusive Resource lock (RangeX_X)
  • Conversion Locks (RangeI_S, RangeI_U, RangeI_X, RangeX_S, RangeX

ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.