调用RestoreDdrTable接口跨地域恢复数据到已有实例。
恢复前可以调用CheckCreateDdrDBInstance接口预检查某RDS实例是否可以用跨地域备份集进行跨地域恢复。
仅适用于如下实例:
- MySQL 8.0高可用版(本地SSD盘)
- MySQL 5.7高可用版(本地SSD盘)
- MySQL 5.6
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | RestoreDdrTable |
系统规定参数,取值:RestoreDdrTable。 |
DBInstanceId | String | 是 | rm-bpxxxxx |
要恢复的已有实例ID。 |
RestoreType | String | 是 | 0 |
恢复方式,取值:
默认值:0。 |
RegionId | String | 否 | cn-hangzhou |
目标地域ID,可以通过接口DescribeRegions查看地域ID。 |
ClientToken | String | 否 | ETnLKlblzczshOTUbOCzxxxxxxxxxx |
用于保证请求的幂等性,防止重复提交请求。由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过64个ASCII字符,且该参数值中不能包含非ASCII字符。 |
BackupId | String | 否 | 279563 |
跨地域备份集ID。可以通过接口DescribeCrossRegionBackups查询。 说明 RestoreType=0时需要传入此参数。
|
RestoreTime | String | 否 | 2020-04-25T16:00:00Z |
恢复时间点恢复的时间,需要早于当前时间。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 说明 RestoreType=1时需要传入此参数。
|
SourceRegion | String | 否 | cn-beijing |
基于时间点恢复的来源地域。 说明 RestoreType=1时需要传入此参数。
|
SourceDBInstanceName | String | 否 | rm-bpxxxxx |
基于时间点恢复的来源实例ID。 说明 RestoreType=1时需要传入此参数。
|
TableMeta | String | 否 | [{"type":"db","name":"testdb1","newname":"testdb1","tables":[{"type":"table","name":"test1","newname":"test1_backup"},{"type":"table","name":"test2","newname":"test2_backup"}]}] |
指定恢复的库表。格式:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 75BBF1EF-1E90-4950-BFFB-252D26E8259B |
请求ID。 |
示例
请求示例
http(s)://rds.aliyuncs.com/?Action=RestoreDdrTable
&DBInstanceId=rm-bpxxxxx
&RestoreType=0
&BackupId=279563
&TableMeta=[{"type":"db","name":"testdb1","newname":"testdb1","tables":[{"type":"table","name":"test1","newname":"test1_backup"},{"type":"table","name":"test2","newname":"test2_backup"}]}]
&<公共请求参数>
正常返回示例
XML
格式
<RestoreDdrTableResponse>
<RequestId>75BBF1EF-1E90-4950-BFFB-252D26E8259B</RequestId>
</RestoreDdrTableResponse>
JSON
格式
{
"RequestId": "75BBF1EF-1E90-4950-BFFB-252D26E8259B"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidRestoreType.Format | Specified restore type is not valid. | 指定的恢复类型无效。 |
403 | ChildDBInstanceExists | Current DB instance had child instance. | 当前DB实例有子实例。 |
400 | InvalidRestoreTime.Format | Specified restore time is not valid. | 指定的恢复时间无效。 |
404 | InvalidBackupSetID.NotFound | Specified backup set ID does not exist. | 指定的备份集 ID 不存在。 |
403 | InvalidBackupLogStatus | Current backup log enable status does not support this operation. | 日志备份未开启,无法按时间点恢复 |
404 | InvalidBackup.NotFound | The available backup does not exist in recovery time. | 还原时不存在可用备份。 |
404 | InvalidBinlog.NotFound | The available binlog does not exist in recovery time. | 指定恢复的时间点没有有效的binlog |
403 | IncorrectBackupSetMethod | Current backup set method does not support operations. | 指定的备份集不支持库表恢复 |
403 | IncorrectBackupSetState | Current backup set state does not support operations. | 当前备份集状态不支持此操作。 |
400 | InvalidParamTableMeta | Invalid parameter TableMeta is null or not json format | 参数tablemeta不合法 |
400 | InvalidParamTableMeta.Content | TableMeta missing old dbname or new dbname, please check | 指定的table_meta参数缺少指定恢复的旧表和新表 |
400 | InvalidParamTableMeta.Duplicate | TableMeta has duplicate db or table with other newname, commons or system | 数据库中已存在指定恢复的库表 |
400 | InvalidSourceRestoreDBName.NotFound | specific source restore dbname is not found in db list | 备份集中不存在指定恢复的数据库 |
400 | InvalidDBName.Duplicate | Specified DB name already exists in the This instance. | 该实例已存在同名的数据库。 |
404 | InvalidDB.NotFound | Specified db does not exist or DB status does not support. | 指定恢复的备份集中不存在指定的库表 |
400 | InvalidParameters.Format | Specified parameters is not valid. | 指定参数有无效值。 |
400 | InvalidAvZone.Format | Specified AvZone is not valid. | 指定的avzone不合法 |
400 | InvalidRegion.Format | Specified Region is not valid. | 指定的region不合法 |
400 | InvalidVpcParameter | Specified VPCId VSwitchId or IPAddress or TunnelId is not valid. | 指定的VPCId VSwitchId不合法 |
400 | MissingUserID | The request is missing a user_id parameter. | 渠道不存在 |
400 | MissingUID | The request is missing a uid parameter. | 账号不存在 |
404 | InvalidDBInstance.NotFound | Specified instance does not exist or not support. | 指定的实例不存在 |
访问错误中心查看更多错误码。