Import bacpac fails with “does not contain QueryStoreStaleQueryThreshold”

这一生的挚爱 提交于 2019-12-09 02:36:55

问题


I am getting the error below when trying to import bacpac file from Azure sql database with management studio 2014. I have upgraded the Azure sql database to v12 and suspect it has something to do with this, but it works with some v12 databases and fails on some.

Does anyone know how to resolve this?

Could not load schema model from package. (Microsoft.SqlServer.Dac)

------------------------------ ADDITIONAL INFORMATION:

The Element or Annotation class SqlDatabaseOptions does not contain the Property class QueryStoreStaleQueryThreshold. (Microsoft.Data.Tools.Schema.Sql)


回答1:


Let me try and help here. We've seen other users report this when they have also enabled the new Index Advisor feature. There is a workaround along with a detailed description of the issue here. https://social.msdn.microsoft.com/Forums/azure/en-US/ac9deff4-e0fe-4de0-98ec-9059e917e0bc/database-export-bacpacs-can-no-longer-be-imported-sqldatabaseoptions-querystoredesiredstate?forum=ssdsgetstarted




回答2:


This did the trick for me..

ALTER DATABASE [Database-Name] SET QUERY_STORE = on;
GO
ALTER DATABASE [Database-Name]
SET QUERY_STORE (
    OPERATION_MODE = READ_WRITE,
    CLEANUP_POLICY = 
    (STALE_QUERY_THRESHOLD_DAYS = 367)
);
GO
ALTER DATABASE [Database-Name] SET QUERY_STORE = off;
GO

I made a new bacpac and imported that one and it worked..




回答3:


I experienced the same problem with Management Studio 2016 CTP 2.3 (August preview). I have updated to Management Studio 2016 CTP 3.0 (October preview) and the .bacpac import works as a charm.




回答4:


I had same issue, I got Index Adviser active. I had SQL server 2014 Management studio. I upgrade to SP1, and try to install some hotfix, but nothing work. I was about to install 2016 edition, but then as last try instead of downloading Bacpac from Azure Portal, I use Management studio 2014 sp1 to connect to my DB and Export the Bacpac, and then try to import that Version it goes through fine.

I don't have to run those queries to turn off adviser, or any alteration. So just want to suggest if you have SQL server 2014 Edition upgrade it to SP1 and then export DB using it, this ensure that you create Bacpac that is compatible with that Management studio version as management studio is one that is writing the bacpac. Hope that help someone, who don't want to alter db.

on my machine, download bacpac from Azure's portal still don't work.



来源:https://stackoverflow.com/questions/33341457/import-bacpac-fails-with-does-not-contain-querystorestalequerythreshold

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!