Wednesday, April 20, 2011

How do you find out blocking in sql ?

Find blocking in single database.

->Run sp_who2

->By running above sp,we can able to find out blockings by presence of blkby column value.

->Find the spid related to the  blkby value row.

->Find the sql statement responsible for blocking by

DBCC INPUTBUFFER(spid)

->if select statement pertaining to that spid means,kill that spid.

 KILL spid

->if insert,update,delete statement pertaining to that spid means,discuss with customer before killing the spid.


No comments:

Post a Comment

MYSQL:::Seamless Data Archiving: Exporting, Importing, and Pruning MySQL Tables

  Seamless Data Archiving: Exporting, Importing, and Pruning MySQL Tables Introduction: In the dynamic landscape of database management...