All Products
Search
Document Center

ApsaraDB RDS:RecoveryDBInstance

Last Updated:Dec 06, 2023

Restores a database.

Operation Description

You can call this operation to restore databases to a new instance or an existing instance. If you want to restore databases to an existing instance, we recommend that you call the Copy databases operation.

If you want to restore databases to a new instance, you must create an instance and then restore specific or all databases to the new instance.

  • If you specify the name of a database, only the specified database is restored to the new instance.
  • If you do not specify the name of a database, all databases are restored to the new instance.
Note This operation is supported only for instances that run SQL Server 2012 or later.

debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

debugging

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
rds:RecoveryDBInstanceWRITE
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceClassstringNo

The instance type of the new instance. For more information, see Instance types.

rds.mysql.s2.large
DBInstanceStorageintegerNo

The storage capacity of the new instance. Unit: GB. For more information, see Instance types.

5
PayTypestringNo

The billing method of the new instance. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
Postpaid
InstanceNetworkTypestringNo

The network type of the new instance. Valid values:

  • Classic
  • VPC

By default, the new instance uses the same network type as the original instance.

VPC
DBInstanceIdstringNo

The ID of the original instance.

Note
  • If you specify BackupId, you do not need to specify this parameter.
  • If you specify RestoreTime, you must also specify this parameter.
  • rm-xxxxxxxx1
    TargetDBInstanceIdstringNo

    The ID of the destination instance.

    rm-uf6wjk5xxxxxxx
    DbNamesstringYes

    The name of the database.

    • If you want to restore databases to a new instance, the value is in the format of Original database name 1,New database name 2.
    • If you want to restore databases to an existing instance, the value is in the format of {"Original database name 1":"New database name 1","Original database name 2":"New database name 2".
    Restore databases to a new instance: test1,test2. Restore databases to an existing instance: {"test1":"newtest1","test2":"newtest2"}
    BackupIdstringNo

    The ID of the backup set. You can call the DescribeBackups operation to query the ID of the backup set.

    If you specify this parameter, you do not need to specify DBInstanceId.

    Note You must specify at least one of BackupId and RestoreTime.
    29304****
    RestoreTimestringNo

    The point in time to which you want to restore data. The point in time must fall within the specified log backup retention period. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

    If you specify this parameter, you must also specify DBInstanceId.

    Note You must specify at least one of BackupId and RestoreTime.
    2011-06-11T16:00:00Z
    VPCIdstringNo

    The VPC ID of the new instance.

    vpc-xxxxxxxxxxx
    VSwitchIdstringNo

    The vSwitch ID of the new instance. If you specify more than one vSwitch ID, you must separate the IDs with commas (,).

    vsw-xxxxxxxxxxx
    PrivateIpAddressstringNo

    The internal IP address of the new instance. The internal IP address must be within the CIDR block that is supported by the specified vSwitch. The system automatically assigns a private IP address to an instance based on the values of VPCId and VSwitchId.

    172.XXX.XXX.69
    UsedTimestringNo

    The subscription duration of the instance. Valid values:

    • Valid values when Period is set to Year: 1 to 3.****
    • Valid values when Period is set to Month: 1 to 9.****
    Note This parameter must be specified when PayType is set to Prepaid.
    1
    PeriodstringNo

    The unit that is used to calculate the billing cycle of the new instance. This parameter takes effect only when you select the subscription billing method for the new instance. Valid values:

    • Year
    • Month
    Note This parameter must be specified when PayType is set to Prepaid.
    Month
    DBInstanceStorageTypestringNo

    The storage type of the new instance. Valid values:

    • local_ssd/ephemeral_ssd: local SSD
    • cloud_ssd: standard SSD
    • cloud_essd: enhanced SSD (ESSD)
    local_ssd

    Response parameters

    ParameterTypeDescriptionExample
    object

    The response parameters.

    DBInstanceIdstring

    The ID of the instance.

    rm-xxxxxxx
    RequestIdstring

    The ID of the request.

    EFB6083A-7699-489B-8278-C0CB4793A96E
    OrderIdstring

    The ID of the order.

    54325****

    Examples

    Sample success responses

    JSONformat

    {
      "DBInstanceId": "rm-xxxxxxx",
      "RequestId": "EFB6083A-7699-489B-8278-C0CB4793A96E",
      "OrderId": "54325****"
    }

    Error codes

    HTTP status codeError codeError messageDescription
    400IllegalParameterillegal parameter, param is empty.The values of some parameters are invalid.
    400InvalidRecoveryDbInstance.StorageSizeThe disk space of the new instance cannot be less than that of the current instanceThe operation failed. The available storage space of the new RDS instance must be greater than or equal to the total size of data stored in the original RDS instance.
    400DBCountLimitExceededDb count limit exceeded.The number of databases is exceeded.
    403Forbidden.SnapshotRecoverySnapshot backup does not support partial restoreThe operation failed. Snapshot backup files cannot be used to restore only a specific part of data.
    403StorageLimitExceededExceeding the allowed Storage of DB instance-

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2023-09-08The error codes of the API operation change.see changesets
    Change itemChange content
    Error CodesThe error codes of the API operation change.
      Error Codes 403 change
      delete Error Codes: 400
    2023-06-09The error codes of the API operation change.see changesets
    Change itemChange content
    Error CodesThe error codes of the API operation change.
      delete Error Codes: 400
      delete Error Codes: 403