문제

MS SQL Server 2008r2: I restore production databases on top of a staging instance that I use for testing. Is it possible to also copy the plan-cache and/or statistics to the staging instance, to better simulate the production environment for testing purposes?

도움이 되었습니까?

해결책

You cannot copy individual plans form one server to another. You can copy statistics - generate script and run it on the test/staging env.

Mainly, you should focus on -

Constraints, Statistics, Table size (number of rows and pages) and Database options along with sessions SET options and hardware resources (maxdop and max memory settings) inorder for the query optimizer to select a plan.

Alternatively, you can use plan guide for single queries.

Again, since you are on sql server 2008 R2, you cannot use query store or dbcc clone database.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top