【发布时间】:2021-09-18 15:02:54
【问题描述】:
我正在尝试将 Azure 数据库备份到我的本地计算机,然后使用 Powershell 还原到 Azure 中的其他位置。 我正在使用的脚本是
# Define clear text string for username and password
[string]$userName = '<username>'
[string]$userPassword = '<password>'
# Convert to SecureString
[securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force
[pscredential]$credObject = New-Object System.Management.Automation.PSCredential ($userName,
$secStringPassword)
Backup-SqlDatabase -ServerInstance "<server>.database.windows.net" -Database "TestDB" -
BackupFile "c:\testbackup.bak" -Credential $credObject
但我得到了错误:
Backup-SqlDatabase : System.Data.SqlClient.SqlError: Statement 'BACKUP DATABASE' is not
supported in this version of SQL Server.
是否有不同的命令可以使用 Powershell 备份任何版本的 Azure 数据库?
【问题讨论】:
标签: powershell azure-sql-database azure-backup-vault