共用方式為


Restore-AzPostgreSqlFlexibleServer

從現有的備份還原伺服器

語法

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

Description

從現有的備份還原伺服器

範例

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

$restorePointInTime = (Get-Date).AddMinutes(-10)
Restore-AzPostgreSqlFlexibleServer -Name pg-restore -ResourceGroupName PowershellPostgreSqlTest -SourceServerName postgresql-test -RestorePointInTime $restorePointInTime

Name           Location  SkuName         SkuTier        AdministratorLogin StorageSizeGb
----           --------  -------         -------        ------------------ -------------
pg-restore     East US   Standard_D2s_v3 GeneralPurpose daeunyim           128

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

範例 1:使用 PointInTime Restore 搭配不同的網路資源還原 PostgreSql 伺服器

$Subnet = '/subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/PowershellPostgreSqlTest/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnetname'
$DnsZone = '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/postgresqltest/providers/Microsoft.Network/privateDnsZones/testserver.private.postgres.database.azure.com'
$restorePointInTime = (Get-Date).AddMinutes(-10)
Restore-AzPostgreSqlFlexibleServer -Name pg-restore -ResourceGroupName PowershellPostgreSqlTest -SourceServerName postgresql-test -RestorePointInTime $restorePointInTime -Subnet $subnet -PrivateDnsZone $DnsZone

Name           Location  SkuName         SkuTier        AdministratorLogin StorageSizeGb
----           --------  -------         -------        ------------------ -------------
pg-restore     East US   Standard_D2s_v3 GeneralPurpose daeunyim           128

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

參數

-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

-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

從 還原的時間點(ISO8601格式),例如 2017-04-26T02:10:00+08:00。

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

-SourceServerName

來源伺服器的名稱。

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

-Subnet

私人存取伺服器將建立的現有子網標識碼。 請注意,子網將會委派給 Microsoft.DBforPostgreSQL/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

輸出