SSMS 2016 错误导入 Azure SQL v12 bacpac:不支持没有密码的主密钥
我已经这样做了几十次,但最近遇到了这个错误.以下是我到达这里所经历的步骤:
I have done this dozens of times but just recently ran into this error. Here are the steps I have gone through to get here:
- 在与原始数据库相同的服务器上创建我的 Azure SQL v12 数据库的副本
- 将复制版本(从用户交互中完全不活动)导出到 blob 存储
- 将 .bacpac 文件从 blob 存储下载到我的本地驱动器
- 在 SSMS(2016 年 10 月版)我的本地 sql 服务器实例中,右键单击数据库"并选择导入数据层应用程序"
- 选择我最近下载的 bacpac 文件并开始导入
它只需要几秒钟就炸毁了,我得到了错误:
It only takes a few seconds for it to bomb out and I get the error:
Error SQL72014: .Net SqlClient Data Provider: Msg 33161, Level 15, State 1, Line 1 Database master keys without password are not supported in this version of SQL Server
Error SQL72045: Script execution error. The executed script: CREATE MASTER KEY;
我在 1.5 个月前对同一个数据库执行了相同的过程,一切正常……还有其他人遇到过这个吗???我安装了 SSDT 版本 14.0.61021.0 - 不确定这是否重要.我也在运行 SQL Server 2016 开发人员版 (v13.0.1722.0).
I followed the same process for the same database 1.5 months ago any everything worked fine...Is anyone else experiencing this??? I have SSDT version 14.0.61021.0 installed - not sure if that matters or not. I'm also running SQL Server 2016 Developer Edition (v13.0.1722.0).
推荐答案
好吧,我最终解决这个问题的方法是执行以下操作:
Okay the way I ended up resolving this issue was to do the following:
- 在与原始数据库相同的服务器上创建 SQL Azure 数据库的副本
在该数据库中运行以下脚本:
- Create a copy of the SQL Azure database on the same server as the original
In that database run the following script:
ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = [password here];
我还没有看到关于此的文档,但很明显,当您创建 Azure SQL 数据库时,它会创建一个没有密码的数据库主密钥 (DMK),而在 SQL Server 2016 中这是不行的.希望这可以帮助其他人.
I haven't seen documentation on this, but apparently when you create an Azure SQL database it creates a database master key (DMK) without a password, and in SQL Server 2016 this is not okay. Hopefully this helps somebody else out.
注意:我能够这样做是因为我只希望原始数据库中的数据刷新我的本地开发副本 - 我还没有完全研究这的含义.
Note: I was able to do this since I only wanted the data from the original database to refresh my local development copy - I haven't fully researched the implications of this.
相关文章