共用方式為


Restore-AzPostgreSqlServer

從現有的備份還原伺服器

語法

Restore-AzPostgreSqlServer
       -Name <String>
       -ResourceGroupName <String>
       [-SubscriptionId <String>]
       -InputObject <IServer>
       [-UseGeoRestore]
       [-Location <String>]
       [-Sku <String>]
       [-Tag <Hashtable>]
       [-DefaultProfile <PSObject>]
       [-AsJob]
       [-NoWait]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restore-AzPostgreSqlServer
       -Name <String>
       -ResourceGroupName <String>
       [-SubscriptionId <String>]
       -InputObject <IServer>
       [-Location <String>]
       [-Sku <String>]
       [-Tag <Hashtable>]
       -RestorePointInTime <DateTime>
       [-UsePointInTimeRestore]
       [-DefaultProfile <PSObject>]
       [-AsJob]
       [-NoWait]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

從現有的備份還原伺服器

範例

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

Get-AzPostgreSqlServer -ResourceGroupName PostgreSqlTestRG -ServerName postgresqltestserverreplica | Restore-AzPostgreSqlServer -Name PostgreSqlTestServer -ResourceGroupName PostgreSqlTestRG -UseGeoRestore

Name                 Location AdministratorLogin Version StorageProfileStorageMb SkuName   SkuTier        SslEnforcement
----                 -------- ------------------ ------- ----------------------- -------   -------        --------------
postgresqltestserver eastus   pwsh               9.6     5120                    GP_Gen5_4 GeneralPurpose Enabled

此 Cmdlet 會使用 GeoReplica Restore 還原 PostgreSql 伺服器。

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

$restorePointInTime = (Get-Date).AddMinutes(-10)
Get-AzPostgreSqlServer -ResourceGroupName PostgreSqlTestRG -ServerName PostgreSqlTestServer | Restore-AzPostgreSqlServer -Name PostgreSqlTestServerGEO -ResourceGroupName PostgreSqlTestRG -RestorePointInTime $restorePointInTime -UsePointInTimeRestore

Name                    Location AdministratorLogin Version StorageProfileStorageMb SkuName   SkuTier        SslEnforcement
----                    -------- ------------------ ------- ----------------------- -------   -------        --------------
postgresqltestservergeo eastus   pwsh               9.6     5120                    GP_Gen5_4 GeneralPurpose Enabled

這些 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

-InputObject

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

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

-Location

資源所在的位置。

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

-Name

伺服器的名稱。

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

-NoWait

以異步方式執行命令。

類型:SwitchParameter
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

-Sku

sku 的名稱,通常是階層 + 系列 + 核心,例如B_Gen4_1,GP_Gen5_8。

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

-SubscriptionId

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

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

-Tag

以索引鍵/值組形式的應用程式特定元數據。

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

-UseGeoRestore

使用地理位置模式還原

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

-UsePointInTimeRestore

使用 PointInTime 模式還原

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

-WhatIf

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

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

輸入

輸出