首页 技术 正文
技术 2022年11月15日
0 收藏 607 点赞 3,669 浏览 2226 个字
2017-11-01 09:49:44.35 spid166     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2017-11-01 09:49:47.85 spid166 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2017-11-01 09:49:47.85 spid166 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.

数据库ERRORLOG中出现类似记录,因此去查找相关的文档,发现SQL Server在做一些配置变更时会彻底清除一次执行计划缓存,这很好的解释了许多时候修改最大内存也会导致执行计划变更,SQL执行性能变化的现象。具体的官方文档为:https://support.microsoft.com/en-us/help/917828/you-may-experience-a-decrease-in-query-performance-after-you-perform-c

但是官网也申明此类现象只在SQL Server2005SP2之前的版本出现,以后的版本已经修复,具体表现还未可知。

文档中列出了所有可能导致此种情况出现的操作:

    • 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:
      • OFFLINE
      • ONLINE
      • MODIFY FILEGROUP DEFAULT
      • MODIFY_NAME
      • MODIFY FILEGROUP READ_WRITE
      • COLLATE
      • MODIFY FILEGROUP READ_ONLY
      • READ_ONLY
      • READ_WRITE
    • 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

      Note Procedure cache will not be cleared if the actual value does not change or if the new value for the max server memory server option is set to 0.

上一篇: DAC连接
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,491
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,493
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,294