snippetsqlModerate
How to clear all plans from a single database?
Viewed 0 times
howalldatabasesingleclearfromplans
Problem
I want to clear out the procedure cache for just one database, not the entire SQL Server. Is there a way?
Solution
DBCC FLUSHPROCINDB ()This command allows you to specify a particular database id, and then clears all plans from that particular database. Check more information here.
DBCC FREEPROCCACHEThis command removes all cached plans from memory
It is, of course, recommended that you don’t use these commands on
your production servers, as it could impact the performance of your
running applications. Usually, you want to keep plans in cache.
Code Snippets
DBCC FLUSHPROCINDB (<db_id>)DBCC FREEPROCCACHEContext
StackExchange Database Administrators Q#148694, answer score: 15
Revisions (0)
No revisions yet.