文档

UpgradeDBInstanceMajorVersion - 升级RDS PostgreSQL数据库大版本

更新时间:

该接口用于发起RDS PostgreSQL实例大版本升级任务。

接口说明

适用引擎

RDS PostgreSQL

相关功能文档

该 API 操作涉及费用,请仔细阅读相关功能文档,确保完全了解使用接口产生的费用、前提条件及使用后造成的影响后,再进行操作。

RDS PostgreSQL 升级数据库大版本

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
rds:UpgradeDBInstanceMajorVersionWrite
  • DBInstance
    acs:rds:*:{#accountId}:dbinstance/{#DBInstanceId}

请求参数

名称类型必填描述示例值
DBInstanceClassstring

升级后实例规格。CPU 和内存配置必须大于等于原实例规格。

例如,原实例规格pg.n2.small.2c的 CPU 为 1 核,内存为 2GB,可升级为pg.n2.medium.2c,CPU 为 2 核,内存为 4 GB。

说明 RDS PG 的实例规格代码,请参见RDS PostgreSQL 主实例规格列表
pg.n2.medium.2c
DBInstanceStorageinteger

升级后实例存储空间。

单位:GB

取值范围:

  • ESSD PL1 云盘:20 GB ~ 3200 GB
  • ESSD PL2 云盘:500 GB ~ 3200 GB
  • ESSD PL3 云盘:1500 GB ~ 3200 GB
说明 本地盘实例升级大版本时,支持存储空间缩容。可选择的最小存储空间,请参见升级数据库大版本
20
PayTypestring

计费方式。固定配置为按量付费,取值 Postpaid。

说明 升级后如果需要变更实例的计费方式,请参见按量付费转包年包月
Postpaid
InstanceNetworkTypestring

升级后实例网络类型。固定配置为 VPC,当前只支持专有网络实例进行大版本升级。

如果网络类型为经典网络,请先切换为专有网络。关于如何查看或切换网络类型,请参见切换网络类型

VPC
SwitchTimeModestring

该参数与 SwitchOver 配合使用,只有 SwitchOver 参数取值为 true 时有效。表示割接时间。

取值范围:

  • Immediate:立即生效。
  • MaintainTime:在可运维时间段内生效,可调用 ModifyDBInstanceMaintainTime 接口修改可运维时间段。
Immediate
SwitchTimestring

预留参数,无需配置。

2021-07-10T13:15:12Z
SwitchOverstring

割接配置,系统将创建一个新实例进行数据迁移。请选择迁移后是否自动切换至新实例。

取值范围:

  • true:割接,自动切换。
  • false:不割接,不自动切换。此选项一般用于正式升级之前测试当前业务在新版本中的兼容性。
说明
  • 如果选择了割接:
    • 割接后无法回退,请谨慎选择。
    • 切换过程中,原实例会被变为只读,业务无法写入,请务必在业务低峰期进行。
    • 如果原实例中创建了只读实例,则无法选择割接。只能通过不割接升级实例,且原只读实例不会被克隆。升级完成后,您需要在新版本实例中另行创建 PostgreSQL 只读实例。
  • 如果选择了不割接:
    • 迁移过程中,原实例的业务不会受到影响。
    • 如需通过不割接升级实例,需在迁移完成后把应用程序中的数据库连接地址改为新实例的连接地址。如何查看连接地址,请参见查看或修改内外网地址和端口
  • false
    CollectStatModestring

    选择在哪个时间点对数据库执行统计信息收集。

    • Before:表示割接前收集,可以保证业务稳定性。如果实例数据量太大可能会导致升级时间较久。
    • After:表示割接后收集,实例升级速度较快。升级后访问未生成统计信息的表可能导致执行计划不准确,业务高峰期还可能导致数据库宕机。
    说明 对于不割接场景,割接前收集表示新实例开放读写前收集,割接后收集表示新实例开放读写后收集。
    After
    TargetMajorVersionstring

    升级后实例目标大版本。必须与执行升级前检查时设置的目标版本一致。

    说明 可通过调用 UpgradeDBInstanceMajorVersionPrecheck 接口执行大版本升级前检查。
    13.0
    DBInstanceIdstring

    原实例 ID。

    pgm-bp1gm3yh0ht1****
    VPCIdstring

    VPC ID。可以通过 DescribeDBInstanceAttribute 接口查看原实例的 VPC ID。

    vpc-bp1opxu1zkhn00gzv****
    VSwitchIdstring
    • 当原实例为基础系列实例时,配置目标实例交换机 ID。
    • 当原实例为高可用系列实例时,可以配置目标主备实例交换机 ID,使用逗号(,)分隔。
    说明 配置的目标实例交换机需要与原实例处于同一可用区。可调用 DescribeVSwitches 接口查询获取。
    vsw-bp10aqj6o4lclxdrm****,vsw-bp10aqj6o4lclxdrm****
    PrivateIpAddressstring

    无需配置,表示目标实例的内网 IP。系统默认通过 VPCId 和 vSwitchId 自动分配。

    172.16.XX.XX
    UsedTimestring

    预留参数,无需配置。

    1
    Periodstring

    预留参数,无需配置。

    Month
    DBInstanceStorageTypestring

    表示升级后实例的存储类型。

    取值范围:

    • cloud_ssd:SSD 云盘
    • cloud_essd:ESSD PL1 云盘
    • cloud_essd2:ESSD PL2 云盘
    • cloud_essd3:ESSD PL3 云盘

    版本升级功能基于云盘快照,当前升级后支持选择的存储类型如下。

    • 当原实例为 SSD 云盘时,可选 SSD 云盘。
    • 当原实例为 ESSD 云盘时,可选 ESSD PL1 云盘、ESSD PL2 云盘、ESSD PL3 云盘。
    • 当原实例为本地 SSD 盘时,可选 ESSD PL1 云盘、ESSD PL2 云盘、ESSD PL3 云盘。
    cloud_essd
    ZoneIdstring

    目标主可用区 ID。可以通过 DescribeRegions 接口查看可用区 ID。

    RDS PostgreSQL 支持升级后将新的实例配置到与原实例同一地域的其他可用区。

    cn-hangzhou-h
    ZoneIdSlave1string

    仅当原实例为高可用系列时,该参数可配置,表示目标实例备可用区 ID。

    RDS PostgreSQL 支持升级后将新的备实例配置到与原实例同一地域的其他可用区。

    可以通过 DescribeRegions 接口查看可用区 ID。

    cn-hangzhou-h
    ZoneIdSlave2string

    预留参数,无需配置。

    cn-hangzhou-h

    返回参数

    名称类型描述示例值
    object

    返回参数详情。

    DBInstanceIdstring

    实例 ID。

    pgm-bp1gm3yh0ht1****
    RequestIdstring

    请求 ID。

    006729E5-2A33-5955-89E3-651D3F44EBE6
    OrderIdstring

    订单 ID。

    21128667463****
    TaskIdlong

    预留参数。

    416980000

    示例

    正常返回示例

    JSON格式

    {
      "DBInstanceId": "pgm-bp1gm3yh0ht1****",
      "RequestId": "006729E5-2A33-5955-89E3-651D3F44EBE6",
      "OrderId": "21128667463****",
      "TaskId": 416980000
    }

    错误码

    HTTP status code错误码错误信息描述
    400InvalidUpgradePrecheckResultThe upgrade precheck failed. No successful precheck task found in the past 7 days升级前置检查失败,无七天内预检查成功任务
    400TargetEngineVersion.Parameters.NotFoundtargetEngineVersion is missing in the request.请求缺少目标数据库版本参数
    400InvalidDBInstanceStorageTypeThe specified DBInstanceStorageType is invalid.指定的数据库实例存储类型无效
    400InvalidInstanceNetworkTypeThe specified InstanceNetworkType is invalid.指定的实例网络类型无效
    400InvalidVPCIdThe specified VPCId is invalid.指定的虚拟专有网络无效
    400InvalidDedicatedHostGroupIdThe specified DedicatedHostGroupId is invalid.指定的专用主机组ID无效
    400InvalidPayTypeThe specified PayType is invalid.指定的付款类型无效
    400InvalidEngineVersionThe specified EngineVersion is invalid.指定的数据库版本号无效
    400InvalidDBInstanceStorageThe specified DBInstanceStorage is invalid.指定的数据库实例存储无效
    400InvalidSwitchOverThe specified SwitchOver is invalid.指定的割接模式无效
    400PrimaryInstanceWithReadonlyNotSupportThe specified primary instance with the read-only instance does not support the operation.具有只读实例的指定主实例不支持此操作
    400InvalidSwitchTimeModeThe specified SwitchTimeMode is invalid.指定的升级时间模式无效
    400InvalidSwitchTimeThe specified SwitchTime is invalid.指定的割接时间无效
    400InvalidCollectStatsThe specified CollectStats is invalid.指定的统计信息收集模式无效
    400IncorrectDBInstanceStateThe current instance state does not support this operation.当前实例状态不支持此操作。
    400InvalidDBinstanceClass.ValueNotSupportedThe specified parameter DBinstanceClass is invalid.指定的参数“实例规格”无效
    400Order.ComboInstanceNotAllowOperateA package instance is not allowed to operate independently.套餐实例不允许单独操作。
    400Price.PricingPlanResultNotFoundPricing plan price result not found.定价计划价格结果没有找到。
    400Order.NoRealNameAuthenticationYou have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.您还未通过实名认证,不符合购买条件,请登录用户中心进行实名认证。
    400InsufficientAvailableQuotaYour account quota limit is less than 0, please recharge before trying to purchase.您的账户可用额度小于0,请先充值后再尝试购买。
    400CommodityServiceCalling.ExceptionFailed to call commodity service.调用商品服务返回失败。
    400RegionDissolvedEOMDear customer, Alibaba Cloud plans to optimize and adjust the current region. Cloud services in this region will cease operations. You are currently unable to operate new purchase orders. Thank you for your understanding and support.客户您好,阿里云计划对当前地域进行优化调整,该区域云服务将停止运营,为确保您的业务连续性及数据迁移工作的平稳过渡,您目前无法操作新购类型的订单,感谢理解与支持。
    400Commodity.InvalidComponentThe module you purchased is not legal, please buy it again.您购买的模块不合法,请重新购买。
    400RegionEndTimeDissolvedIndiaCloud services in the India (Mumbai) region will be discontinued. Set the validity date to July 15, 2024 or earlier than July 15, 2024.客户您好,印度地域裁撤,购买的服务效期不能超过2024.07.15。
    400RegionEndTimeDissolvedAustraliaCloud services in the Australia (Sydney) region will be discontinued. Set the validity date to September 30, 2024 or earlier than September 30, 2024.客户您好,澳洲地域裁撤,购买的服务效期不能超过2024.09.30
    400Price.CommoditySysCommodity system call exception.商品系统调用异常。
    400Pay.InsufficientBalanceInsufficient available balance.可用金不足。
    400Order.PeriodInvalidThere is a problem with the period you selected, please choose again.您选购的周期有问题,请重新选购。
    400pay.noCreditCardAccount not bound to credit card.账户未绑定信用卡。
    400Order.InstHasUnpaidOrderThere is an unpaid order for the service you have purchased. Please pay or void it before placing the order.您选购的服务存在未支付订单,请支付或作废后再下单。
    400noAvailablePaymentMethodNo payment method is specified for your account. We recommend that you add a payment method.没有为您的帐户指定付款方式。我们建议您添加一种付款方式。
    400BasicInfoUncompletedYour information is incomplete. Complete your information before the operation.您的基本信息未完善,请在操作前先完善您的基本信息。
    400Risk.RiskControlRejectionYour account is abnormal, please contact customer service for details.您的账户出现异常,详情请联系客服。
    400BasicInfoUncompletedYour information is incomplete, Complete your information before the operation.您的信息不完整,请在操作前填写您的信息。
    400System.SaleValidateFailedSales expression validation system error.销售表达式校验系统错误。
    403OrderStatus.UnPaidThe specified db instance has unpaid order.实例当前存在未支付订单,请支付后重试。
    404InvalidDBInstanceName.NotFoundThe database instance does not exist.数据库实例名称不存在。请确认数据名称是否正确。
    404IncorrectDBInstanceLockModeCurrent DB instance lock mode does not support this operation.操作失败,实例处于锁定状态。

    访问错误中心查看更多错误码。

    变更历史

    变更时间变更内容概要操作
    暂无变更历史
    • 本页导读 (1)
    文档反馈