简体   繁体   中英

Sql Server Backup to URL (Azure)

I'm trying to take advantage of the new backup to url function in SQL Server. I have created a valid cert and tried a simple backup, but I get the same error every time no matter what I try.
I have also tried creating a new managed backup. With the managed backup I see a new storage container but get no new blobs. When I look through the logs it is getting the same error.

example:

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

Message:

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.

I suggest that use of Redgate backup pro . by this software you can copy your backup in other location (mirror), network, Host storage. You can use URL in network location or mirror location.

在此处输入图片说明

This may or may not be helpful to you, but here is a script I used to backup to URL and restore from URL to a new database.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM