20152015. 8. 25. 17:27

On-Premises 환경의 SQL Server 데이터베이스를 Windows Azure Blob storage 에 백업하고 복원할 수 있습니다.

정상적으로 백업과 복원이 되지 않고 아래와 같은 메시지가 발생한다면? 오류 검색용으로 블로그에 남겨봅니다. :)

 

RESTORE DATABASE Board FROM  URL = N'https://boardstor1.blob.core.windows.net/dbstor/Board_20150825.bak' WITH  CREDENTIAL = N'BoardStorCredential'
/*
Msg 3271, Level 16, State 1, Line 12
A nonrecoverable I/O error occurred on file "https://boardstor1.blob.core.windows.net/dbstor/Board_20150825.bak:" Backup to URL received an exception from the remote endpoint. Exception Message: Error occurred while referencing Blob in remote storage.
Msg 3013, Level 16, State 1, Line 12
RESTORE DATABASE is terminating abnormally.
*/

 

BACKUP DATABASE Board TO URL = 'https://boardstor1.blob.core.windows.net/dbstor/Board_20150825.bak' WITH CREDENTIAL = 'BoardStorCredential', STATS = 10, COMPRESSION

/*
Msg 3271, Level 16, State 1, Line 20
A nonrecoverable I/O error occurred on file "https://boardstor1.blob.core.windows.net/dbstor/Board_20150825.bak:" Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: (403) Forbidden..
Msg 3013, Level 16, State 1, Line 20
BACKUP DATABASE is terminating abnormally.
*/

 

 

Azure Portal 에 등록된 Primary Access Key 가 올바르지 않은 경우에도 위와 같은 오류가 발생할 수 있습니다. 이런 경우 확인된 올바른 Access Key 를 아래와 같은 방법으로 변경하여 백업과 복원을 시도해 보면 좋겠네요.  

 

ALTER CREDENTIAL BoardStorCredential
WITH IDENTITY = 'boardstor1'
       ,SECRET = 'abcc.......dg=='

 

 

 

[참고자료]

SQL Server Backup to URL
https://msdn.microsoft.com/en-us/library/dn435916(v=sql.120).aspx

 

 

작성자 : Lai Go / 작성일자 : 2015.08.25

 

 

Posted by Lai Go