你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
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>]
说明
从现有备份还原服务器
示例
示例 1:使用 PointInTime 还原还原 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 区域的 ID。 可以使用同一资源组、不同资源组或不同订阅中的专用 DNS 区域。 dns 区域的后缀必须与服务器的完全限定域的后缀相同。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
包含资源的资源组的名称,可以从 Azure 资源管理器 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
专用访问服务器将创建到的现有子网的 ID。 请注意,子网将委托给 Microsoft.DBforPostgreSQL/flexibleServers。 委派后,此子网不能用于任何其他类型的 Azure 资源。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-SubscriptionId
标识 Azure 订阅的订阅 ID。
类型: | 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 |