Sql Server备份到URL(Azure)

时间:2014-08-08 20:12:53

标签: sql sql-server azure database-backups

我正在尝试利用SQL Server中的新备份到url功能。我已经创建了一个有效的证书并尝试了一个简单的备份,但无论我尝试什么,我每次都会得到同样的错误 我也尝试过创建一个新的托管备份。使用托管备份,我看到一个新的存储容器,但没有获得新的blob。当我浏览日志时,它会得到同样的错误。

示例:

BACKUP DATABASE [mydb] 
TO  URL = 'https://mybackups.blob.core.windows.net/sqltest-mssqlserver/backup_2014_08_08.bak' 
WITH  
CREDENTIAL = N'AzureCreds' , 
STATS = 1
GO

消息:

Msg 3293, Level 16, State 1, Line 1
An error occurred while Backup/Restore to URL was initializing. Error message: Internal engine error, invalid parameters caused fatal error.

Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

2 个答案:

答案 0 :(得分:0)

我建议使用Redgate backup pro。通过此软件,您可以将备份复制到其他位置(镜像),网络,主机存储。您可以在网络位置或镜像位置使用URL。

enter image description here

答案 1 :(得分:-1)

这可能对您没有帮助,但这是我用来备份到URL并从URL还原到新数据库的脚本。

create credential MyStorage 
with identity='mystorage',
secret = 'secretkey';
GO

backup database mydb1
to URL='https://mystorage.blob.core.windows.net/test1/mydb1.bak'
with credential = 'MyStorage';
GO

restore database mydb2
from URL='https://mystorage.blob.core.windows.net/test1/mydb1.bak'
with credential = 'MyStorage',
move 'mydb1' to 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLENT2014\MSSQL\DATA\mydb2.mdf',
move 'mydb1_log' to 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLENT2014\MSSQL\DATA\mydb2_log.ldf';
GO