将数据库备份到AZURE blob storage

1创建一个Storage Account

1)点击Browse->Storage accounts

 

2) 填写Storage account,请记住这个名字,之后创建credential需要用到。

3)点击Create。 一般等待一段时间就好了

 

 

2 创建container

1)All resources->Blobs

2)在Blob service页面,点击创建一个新的containers.

3)Container的url需要记住,在备份的时候需要指定

 

 

3 创建credential

1) All resource->Access Keys

2)复制两个key中的任意一个.

3) 在需要备份的sql数据库中执行下面的语句

create credential credential1 with identity='liweistoragetest'

,secret='********'

其中的secret的值用上一步得到的key代替。

 

 

 

之后就可以进行备份了

例如

 

 

backup database db1 to url='https://liweistoragetest.blob.core.windows.net/liweistoragetestcontainer/db1.bak'

with credential ='credential1'

 

备份完成后,我们可以在blob看到相应的数据

 

 

posted on 2016-01-11 09:31  stswordman  阅读(918)  评论(0编辑  收藏  举报