understanding locks

  • Hi

    I am trying to understand locks and how i deal with them.

    i have read a couple of articles on them which is fine but i more need a conversation about them so i can get it straight in my own mind.

    Can anyone shed any light on it please.

    Thanks in advance

  • If you follow the link in my signature to the accidental DBA guide and read chapter 6 on blocking, that should give you some good starting points on the subject.

  • What specifically are you unsure on?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • just about everything 🙂

    how they happen

    how you know they have happened

    what can they affect

    how do you unlock

    how do you stop them

    thanks again

  • Read this (http://msdn.microsoft.com/en-us/library/ms187101%28v=sql.105%29) and everything under it, and that chapter that Anthony suggested. Also SQL Server 2008 Internals – Chapter 10

    Two I will address.

    how do you unlock

    You don't. SQL Server manages locking as necessary

    how do you stop them

    You don't, they're a good thing and absolutely essential for proper functioning of a database.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • thanks

    i assume the reading you suggested will cover this but do i need to monitor them or worry about them in any way?

  • Maybe, depends if there are problems or not. If no problems, then no.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • erics44 (7/16/2012)


    Hi

    I am trying to understand locks and how i deal with them.

    i have read a couple of articles on them which is fine but i more need a conversation about them so i can get it straight in my own mind.

    Can anyone shed any light on it please.

    Thanks in advance

    Lock/Locking is a mechanisim that SQL server uses to maintain data integrity.

    Some of the locks are, share lock, update lock, exclusive lock, etc.....

    Dead locks, live lock are some scenarios, in this case SQL server kills one of the spid which uses less overhead cost.

    Regards,

    TA

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply