English 中文(简体)
DBC FreepcrocACCH和 DBC DROPCL DEPC DEABFFFers 的特定范围
原标题:DBCC FREEPROCCACHE and DBCC DROPCLEANBUFFERS alike for specific scope

我想检查改进我的询问的备选办法。

sometimes, i want to do the tests on a production server so i can t use DBCC FREEPROCCACHE and DBCC DROPCLEANBUFFERS to clear the entire server cache.

请你跟我分享一下 做一个"清干净"的方法 只是为了我的连接/镜片吗?

谢谢

问题回答

DBCC FREEPROCACCHE(平面图) (平面图) < sql_handle < pool_name >

通过通过计划或其它选项,我们将能够清除特定 sp或查询的缓存 。

缓冲器不保存在用户专用表格中,或存储在每个用户的存储器中---- SQL 服务器无法有选择地清除它, 因为它不知道要为哪些项目进行查询; 这样做几乎在每一种情况下都会产生不必要的间接费用( 除了你现在要做的事情。 抱歉。 ) 尽管如此, 还是有选择的 。

There are suggestions, however, to ameliorate the issue, even if the problem can t be avoided:

  • You can use with(RECOMPILE) to force the query to find a new plan, but that will not clear the cache.
  • You can run each query twice, to see how slowly/quickly it runs once the data is buffered.
  • You can repeatedly alternate the two methods, to see if they get faster, and what the speed difference converges towards.
  • You can run them a day or two apart, or after a server reset. (This is if the production server gets reset occasionally anyways.)
  • 这篇文章 在这种情形下有额外的测试想法。

    如果停机时间正常,您可以将数据库脱机,然后立即将其上线。





    相关问题
    Export tables from SQL Server to be imported to Oracle 10g

    I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

    SQL server: Can NT accounts be mapped to SQL server accounts

    In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...

    SQL Server 2000, ADO 2.8, VB6

    How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

    热门标签