Hello all,
We have a recurring issue with our Fees by Performance report freezing up. The only fix I have found (outside of restarting the SQL service or the SQL Server) is to run dbcc freeproccache to clear the procedure cache. Once that has been run, the report works fine. This issue has been a minor annoyance for a few years now, but since we have updated to 12.03 the report freezes very frequently.
Does anybody else have this issue? Any clues as to how to fix this? I'm not crazy about clearing the procedure cache every day, but that is what's been needed lately.
Thanks!
Jeff
I have had it do this for a different issue, GiftAid at the moment but also had it for Direct Debit processing and use the following script to ensure I only remove the cache for related queries.
DECLARE @PlanHandle VARBINARY(255);DECLARE @TopQueries TABLE (plan_handle VARBINARY(255));INSERT INTO @TopQueriesSELECT plan_handleFROM sys.dm_exec_cached_plans CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS stWHERE st.text LIKE N'%giftaid%'DECLARE TopQueryCursor CURSOR FOR SELECT plan_handle FROM @TopQueriesOPEN TopQueryCursorFETCH NEXT FROM TopQueryCursor INTO @PlanHandle;WHILE @@FETCH_STATUS = 0BEGIN DBCC FREEPROCCACHE(@PlanHandle); FETCH NEXT FROM TopQueryCursor INTO @PlanHandle;ENDCLOSE TopQueryCursorDEALLOCATE TopQueryCursor
At least that way you may only remove the plans related to that report rather than the whole cache.
Mark
Thanks Mark, I hadn't thought of that. Great solution to the problem!
I appreciate the help.