恢复SQL Server数据库 - 主密钥不打开 [英] Restoring SQL Server Database - Master Key Not Opening

查看:209
本文介绍了恢复SQL Server数据库 - 主密钥不打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须制作远程SQL Server数据库的本地副本。我通过使用任务>从管理工作室备份。我然后在本地恢复备份,这似乎有一切 - 表,用户,对称密钥和证书。

I have to make a local copy of a remote SQL Server database. I did this by using Tasks > Backup from Management Studio. I then locally restored the backup, which seems to have everything -- tables, users, symmetric key, and certificate.

当我尝试执行一个需要我的选择打开对称密钥并通过证书解密,我得到这个错误:

When I try to perform a select that requires me to open the symmetric key and decrypt by the certificate, I get this error:

Please create a master key in the database or open the master key in the session before performing this operation.

为什么我被要求这个,为什么它不会像在远程服务器?

Why am I being asked for this, and why doesn't it open automatically like it does on the remote server?

我已经尝试更改主密钥,但没有原始密码,我不能做太多。

I've tried changing the master key, but without the original password, I can't do much.

推荐答案

问题是SMK已经改变(因为机器已经改变)。有一篇文章解释它这里。只需导出和导入SMK,请记住,您的复制系统中的任何加密数据将无法读取。

The problem is the SMK has changed (since the machine has changed). There's an article explaining it here. Just export and import the SMK -- bearing in mind that any encrypted data in your copied-to system will be unreadable.

MSDN文章:

  • Backing up the SMK
  • Restoring the SMK

这篇关于恢复SQL Server数据库 - 主密钥不打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆