SQL Server has encountered occurrences of cachestore flush.
Applies to: SQL Server 2005 Standard Edition SP3.
Problem Description.
One of my customers asked me about the following messages he found on the SQL
Server Error Log of a SQL Server instance:
52:40.1 spid225 SQL Server has encountered 2 occurrence(s) of cachestore flush
for the 'Bound Trees' cachestore (part of plan cache) due to some database
maintenance or reconfigure operations.
52:40.1 spid225 SQL Server has encountered 2 occurrence(s) of cachestore flush
for the 'SQL Plans' cachestore (part of plan cache) due to some database
maintenance or reconfigure operations.
52:39.8 spid225 SQL Server has encountered 2 occurrence(s) of cachestore flush
for the 'Object Plans' cachestore (part of plan cache) due to some database
maintenance or reconfigure operations.
Cause
After examining the SQL Server Error Log I found the entries were appearing
after some restore operations. Entries like the following were found prior to
the ones found by my customer.
The database 'XXXX' is marked RESTORING and is in a state that does not allow
recovery to be run.
These messages are common on SQL Server 2005 SP2 up to SQL Server 2005 SP4. This
does not happen on SQL Server 2008 and later.
The support article KB917828 have this issue documented, and enumerates other
possible causes for those messages like these ones: