本课演示如何使用 tsql 语句执行到 Windows Azure Blob 存储服务的完整数据库备份。
执行到 Windows Azure Blob 存储服务的完整数据库备份
若要创建完整数据库备份,请使用以下步骤:
连接到 SQL Server Management Studio。
在**“对象资源管理器”**中,连接到 SQL Server 2012 的实例。
在标准菜单栏上,单击**“新建查询”**。
将以下示例复制并粘贴到查询窗口中,根据需要进行修改,然后单击**“执行”**。
BACKUP DATABASE[AdventureWorks2012] TO URL = 'https://mystorageaccount.blob.core.windows.net/privatecontainertest/AdventureWorks2012.bak' /* URL includes the endpoint for the BLOB service, followed by the container name, and the name of the backup file*/ WITH CREDENTIAL = 'mycredential'; /* name of the credential you created in the previous step */ GO
在对象资源管理器中,连接到 Azure 存储。 通过浏览找到容器和新创建的备份文件。
有关数据库备份的其他 tsql 和 C# 代码示例,请参阅示例。