將資料庫備份到AZURE blob storage

stswordman發表於2016-01-11

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看到相應的資料

 

 

相關文章