日期:2014-05-17 浏览次数:20827 次
backup database 数据库名 to 备份设备 with skip, medianeme=N '备份设备名 ', mediapassword=N '备份设备密码 ', neme=N '备份集名 ', password=N '备份集密码 ', stats go 如果恢复时不提供密码将无法恢复.
------解决方案--------------------
--语句备份数据库(带密码的备份) BACKUP DATABASE TEST TO DISK ='D:\HTML\sss.bak' WITH INIT, NOUNLOAD , NAME = N'' , password='sunlw' , NOSKIP , STATS = 100, DESCRIPTION = N'', NOFORMAT select * from sys.database_files RESTORE DATABASE TEST1 FROM DISK = 'D:\HTML\sss.bak' WITH RECOVERY, MOVE 'TEST' TO 'D:\HTML\sss.mdf', MOVE 'TEST_Log' TO 'D:\HTML\sss.ldf', password='sunlw'
------解决方案--------------------
除了backup时加password参数,也可以用证书来备份加密.
参考 http://database.ctocio.com.cn/dbzjdysummary/356/8321856.shtml
------解决方案--------------------