SQL blocking a Procedure causing my SharePoint site unavailable
Posted on 2014-11-26
Hello, I am working on a SharePoint environment and I am not very much expert in SQL databases. In my environment there are 2 App Servers, 2 WFE and 1 DB server. I have 3 site collections, and the size of the one Content DB is more than 200GB, other 2 are 120GB and 100GB.
Currently I am facing an issue, that my SharePoint Portal goes down, and on further investigation we found out that there is a SQL deadlock causing the long queue in SQL that we kill manually and afterwards the site comes up and running.
The SQL Procedure that is being blocked is a stored procedure call SPROD_Contect_Intranet.dbo.pro_getStreamsForSite.
On a daily basis we get 40 to 50 plus blocks and we have to manually kill it.
The procedure name is SPPROD_Content_Intranet.dbo.proc_GetStreamsForSite, and the function which is blocking the SQL is INDEX REORGANIZE, What I can see here is very long wait situation which may not be unlocked until “INDEX REORGANIZE” is completed while another command is inserting a record into the same table. Also the SELECT command from the proc_GetStreamsForSite locked the table to get the siteID using the clustered index DocStreams_CI which is under “INDEX REORGANIZE” status. To me the situation looks almost in a dead-locked situation if not force to kill the blocking process which is the proc_GetStreamsForSite.”
Please suggest what could be the root cause and how to resolve it? Many Thanks,