1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
DBCC FREESYSTEMCACHE ('userdatabase') -- cleans cache for specific user database DBCC FREESYSTEMCACHE ('tempdb') -- clears cache for tempdb DBCC FREESYSTEMCACHE ('Temporary Tables & Table Variables') Go DBCC FLUSHPROCINDB (8) -- 8 is the databaseid of Dec_ProdStats GO -- Clean all the caches with entries specific to the resource pool named "default". DBCC FREESYSTEMCACHE ('ALL', default); --MARK_IN_USE_FOR_REMOVAL clause to release entries from all current caches once the entries become unused. DBCC FREESYSTEMCACHE ('ALL') WITH MARK_IN_USE_FOR_REMOVAL; --Suppresses all informational messages. DBCC FREEPROCCACHE with NO_INFOMSGS DBCC DROPCLEANBUFFERS --clears clean (unmodified) pages from the buffer pool Precede that with a CHECKPOINT to flush any dirty pages to disk first DBCC FLUSHPROCINDB --clears execution plans for that database |