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::Setting Validate_Password componet for MySQL Database to ensure password policy settings

Inadequate Password Settings for MySQL Database We observed that the `validate_password%` settings on hostname `<insert hostname>` a...