共用方式為


New-AzureVMSqlServerAutoBackupConfig

建立 SQL Server 自動備份的組態物件。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

New-AzureVMSqlServerAutoBackupConfig
   [-Enable]
   [[-RetentionPeriodInDays] <Int32>]
   [-EnableEncryption]
   [[-CertificatePassword] <SecureString>]
   [[-StorageUri] <Uri>]
   [[-StorageKey] <SecureString>]
   [-BackupSystemDbs]
   [-BackupScheduleType <String>]
   [-FullBackupFrequency <String>]
   [-FullBackupStartHour <Int32>]
   [-FullBackupWindowInHours <Int32>]
   [-LogBackupFrequencyInMinutes <Int32>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
New-AzureVMSqlServerAutoBackupConfig
   [-Enable]
   [[-RetentionPeriodInDays] <Int32>]
   [-EnableEncryption]
   [[-CertificatePassword] <SecureString>]
   [[-StorageContext] <AzureStorageContext>]
   [[-StorageUri] <Uri>]
   [[-StorageKey] <SecureString>]
   [-BackupSystemDbs]
   [-BackupScheduleType <String>]
   [-FullBackupFrequency <String>]
   [-FullBackupStartHour <Int32>]
   [-FullBackupWindowInHours <Int32>]
   [-LogBackupFrequencyInMinutes <Int32>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

New-AzureVMSqlServerAutoBackupConfig Cmdlet 會建立 SQL Server 自動備份的組態物件。

範例

範例 1:使用記憶體 URI 和帳戶金鑰建立自動備份組態

PS C:\> $ABS = New-AzureVMSqlServerAutoBackupConfig -Enable -RetentionPeriod 10 -StorageUri $StorageUrl -StorageKey $StorageAccountKeySecure
Enable                : True
EnableEncryption      : False
RetentionPeriodInDays : 10

此命令會藉由指定記憶體 URL 和帳戶金鑰來建立自動備份組態物件。

範例 2:使用記憶體內容建立自動備份組態

PS C:\> $ABS = New-AzureVMSqlServerAutoBackupConfig -StorageContext $StorageContext -Enable -RetentionPeriod 10
Enable                : True
EnableEncryption      : False
RetentionPeriodInDays : 10

此命令會藉由指定記憶體內容來建立自動備份組態物件。

範例 3:使用記憶體內容搭配加密和密碼建立自動備份組態

PS C:\> $ABS = New-AzureVMSqlServerAutoBackupConfig -StorageContext $StorageContext -Enable -RetentionPeriod 10 -EnableEncryption -CertificatePassword $CertPasswd
Enable                : True
EnableEncryption      : True
RetentionPeriodInDays : 10

此命令會藉由指定記憶體內容並使用密碼啟用加密選項,來建立自動備份組態物件。 儲存在名為 $CertPasswd 變數的 certificatepassword ist。

參數

-BackupScheduleType

備份排程類型、手動或自動化

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-BackupSystemDbs

備份系統資料庫

類型:SwitchParameter
Position:Named
預設值:False
必要:False
接受管線輸入:True
接受萬用字元:False

-CertificatePassword

指定用來執行 SQL Server 加密備份之憑證的密碼。

類型:SecureString
Position:3
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Enable

表示已啟用 SQL Server 虛擬機的自動備份。 如果您使用此參數,自動備份會設定所有目前和新資料庫的備份排程。 這會更新您的受控備份設定,以遵循此排程。

類型:SwitchParameter
Position:0
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-EnableEncryption

表示已啟用加密。

類型:SwitchParameter
Position:2
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-FullBackupFrequency

Sql Server 完整備份頻率,每日或每周

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-FullBackupStartHour

當 Sql Server 完整備份應啟動時,一天中的小時 (0-23)

類型:Int32
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-FullBackupWindowInHours

以小時為單位的 Sql Server 完整備份視窗

類型:Int32
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-InformationAction

指定此 Cmdlet 如何回應資訊事件。

此參數可接受的值為:

  • 繼續
  • 忽略
  • 詢問
  • SilentlyContinue
  • 停止
  • 暫止
類型:ActionPreference
別名:infa
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InformationVariable

指定資訊變數。

類型:String
別名:iv
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-LogBackupFrequencyInMinutes

Sql Server 記錄備份頻率,每 1-60 分鐘一次

類型:Int32
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RetentionPeriodInDays

指定天數的保留期間長度。

類型:Int32
Position:1
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-StorageContext

指定要用來儲存備份的記憶體帳戶。 預設值是與 SQL Server 虛擬機相關聯的記憶體帳戶。

類型:AzureStorageContext
Position:4
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-StorageKey

指定 Blob 記憶體帳戶的記憶體金鑰。

類型:SecureString
Position:5
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-StorageUri

指定 Blob 記憶體帳戶的 URI。

類型:Uri
Position:4
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False