DBCC FREE... CACHE

DBCC FREEPROCCACHE - Remove all elements from the procedure cache.
DBCC FREESESSIONCACHE - Flush the distributed query connection cache.
DBCC FREESYSTEMCACHE - Release all unused cache entries from all caches.

Syntax
      DBCC FREEPROCCACHE [WITH NO_INFOMSGS]

      DBCC FREESESSIONCACHE [WITH NO_INFOMSGS]

      DBCC FREESYSTEMCACHE 
        ('ALL') 
           [WITH  [MARK_IN_USE_FOR_REMOVAL] , [NO_INFOMSGS]  ]

Key:
    NO_INFOMSGS             - Suppress all information messages
    ALL                     - All supported caches
    MARK_IN_USE_FOR_REMOVAL - Free up currently used entries asap (asynchronous)

MARK_IN_USE_FOR_REMOVAL will not prevent new entries being created in the cache.
Requires ALTER SERVER STATE permission on the server.

Examples

USE MyDatabase;
GO
DBCC FREESESSIONCACHE WITH NO_INFOMSGS;
GO DBCC FREEPROCCACHE;

"It's hard to be funny when you have to be clean" ~ Mae West.

Related:

DBCC DROPCLEANBUFFERS
Equivalent Oracle command: ALTER SYSTEM FLUSH SHARED POOL


© Copyright SS64.com 1999-2014
Some rights reserved