共用方式為


Restore-AzMySqlFlexibleServer

從現有的備份還原伺服器

語法

Restore-AzMySqlFlexibleServer
       -Name <String>
       -ResourceGroupName <String>
       [-SubscriptionId <String>]
       -RestorePointInTime <DateTime>
       -InputObject <IServerAutoGenerated>
       [-Zone <String>]
       [-Subnet <String>]
       [-PrivateDnsZone <String>]
       [-DefaultProfile <PSObject>]
       [-AsJob]
       [-NoWait]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

從現有的備份還原伺服器

範例

範例 1:使用 PointInTime Restore 還原 MySql 伺服器

$restorePointInTime = (Get-Date).AddMinutes(-10)
Get-AzMySqlFlexibleServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlFlexibleServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime

Name                 Location  SkuName          SkuTier        AdministratorLogin Version StorageSizeGb
----                 --------  -------          -------        ------------------ ------- -------------
mysql-test-restore   West US 2 Standard_D2ds_v4 GeneralPurpose admin              5.7     32

這些 Cmdlet 會使用 PointInTime Restore 還原 MySql 伺服器。

範例 2:使用新的私人存取資源還原 MySql 伺服器

$restorePointInTime = (Get-Date).AddMinutes(-10)
Get-AzMySqlFlexibleServer -ResourceGroupName PowershellMySqlTest -ServerName mysql-test | Restore-AzMySqlFlexibleServer -Name mysql-test-restore -ResourceGroupName PowershellMySqlTest -RestorePointInTime $restorePointInTime -Subnet <SubnetId> -PrivateDnsZone <PrivateDnsZoneId>

Name                 Location  SkuName          SkuTier        AdministratorLogin Version StorageSizeGb
----                 --------  -------          -------        ------------------ ------- -------------
mysql-test-restore   West US 2 Standard_D2ds_v4 GeneralPurpose admin              5.7     32

這些 Cmdlet 會使用 PointInTime 還原 MySql 伺服器,無論是從私人存取伺服器還原到不同的私人存取資源,還是從公用存取伺服器還原到私人存取伺服器。

參數

-AsJob

以作業身分執行命令。

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

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

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

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

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

-InputObject

要從中還原的來源伺服器物件。 若要建構,請參閱 INPUTOBJECT 屬性的 NOTES 區段並建立哈希表。

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

-Name

伺服器的名稱。

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

-NoWait

以異步方式執行命令。

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

-PrivateDnsZone

現有私人 DNS 區域的識別碼。 您可以使用來自相同資源群組、不同資源群組或不同訂用帳戶的私人 DNS 區域。 dns 區域的後綴必須與伺服器的完整網域相同。

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

-ResourceGroupName

包含資源的資源群組名稱,您可以從 Azure Resource Manager API 或入口網站取得此值。

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

-RestorePointInTime

資源所在的位置。

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

-Subnet

私人存取伺服器將建立的現有子網標識碼。 請注意,子網將會委派給 Microsoft.DBforMySQL/flexibleServers。 委派之後,此子網無法用於任何其他類型的 Azure 資源。

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

-SubscriptionId

識別 Azure 訂用帳戶的訂用帳戶標識碼。

類型:String
Position:Named
預設值:(Get-AzContext).Subscription.Id
必要:False
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

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

-Zone

要在其中布建資源的可用性區域。

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

輸入

輸出