欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

数据库备份启用加密

程序员文章站 2022-06-28 11:53:00
参考https://www.cnblogs.com/xwgli/p/4522502.html @@@code SELECT DB_NAME(database_id) AS DatabaseName, * FROM sys.dm_database_encryption_keys;... ......

参考

 

@@@code

select db_name(database_id) as databasename, * from sys.dm_database_encryption_keys;

go

 

 

use master;

create master key encryption by password = '$$$$';

 

use master;

create certificate backupcert with subject = '备份证书';

 

use master;

backup certificate backupcert to file = 'c:\data\dbbak\bj_yun\backupcert.cer'

with private key ( file = 'c:\data\dbbak\bj_yun\backupcert.pkey', encryption by password = '$$$$' );

 

--还原证书

create certificate backupcert from file = 'c:\temp\backupcert.cer'

with private key ( file = 'c:\temp\backupcert.pkey', decryption by password = '$$$$');

 

@@#

 

还原时,无法解开备份集

数据库备份启用加密

 

进行密钥及证书导入后重新还原,文件被解开,可以列出备份集中的数据库名,正常还原

数据库备份启用加密