Starting with SQL Server 2005 Service Pack 2, you will notice messages such as the following in the SQL Server error log when this issue occurs:
2006-10-15 06:03:29.420 spid59 SQL Server has encountered 4 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2006-10-15 06:03:29.420 spid59 SQL Server has encountered 4 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2006-12-14 11:37:03.57 spid53 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.
Note This behavior does not occur in Microsoft SQL Server 2008.
- A database has the AUTO_CLOSE database option set to ON. When no user connection references or uses the database, the background task tries to close and shut down the database automatically.
- You run several queries against a database that has default options. Then, the database is dropped.
- A database snapshot for a source database is dropped.
Note Database snapshots are only available in Microsoft SQL Server 2005 Enterprise Edition.
- You change the database state to OFFLINE or ONLINE.
- You successfully rebuild the transaction log for a database.
- You restore a database backup.
- You run the DBCC CHECKDB statement.
Note This is true only in versions of SQL Server 2005 that are earlier than SQL Server 2005 SP2. After you install SQL Server 2005 SP2 or later versions, the whole procedure cache is not flushed when you run the DBCC CHECKDB statement.
- You detach a database.
- You specify one of the following options when you run the ALTER DATABASE statement:
- MODIFY FILEGROUP DEFAULT
- MODIFY FILEGROUP READ_WRITE
- MODIFY FILEGROUP READ_ONLY
- The whole procedure cache is cleared if one of the following server options is changed by the RECONFIGURE statement:
- cross db ownership chaining
- index create memory (KB)
- remote query timeout (s)
- user options
- max text repl size (B)
- cost threshold for parallelism
- max degree of parallelism
- min memory per query (KB)
- query wait (s)
- min server memory (MB)
- max server memory (MB)
- query governor cost limit
- Performance object: Process
Counter: %Processor Time
The value of this counter will increase because of increased CPU activity. Essentially, the whole procedure cache is cleared if this issue occurs. Therefore, subsequent requests must generate new plans to be cached. This behavior will slightly increase CPU activity.
- Performance object: SQLServer:Plan Cache
Counter: Cache Object Counts
Performance object: SQLServer:Plan Cache
Counter: Cache Pages
The values of these counters will suddenly decrease.
Note For a named instance of SQL Server 2005, the performance object is named MSSQL$InstanceName:Plan Cache.
- Performance object: SQLServer:SQL Statistics
The value of this counter will significantly increase after this incident.
Note For a named instance of SQL Server 2005, the performance object is named MSSQL$InstanceName: SQL Statistics.
Article ID: 917828 - Last Review: Mar 29, 2017 - Revision: 3