Restores one or more databases or tables of an RDS instance to this RDS instance.

RDS for MySQL supports the restoration of single databases and tables. If you delete one or more databases or tables of an RDS instance by mistake, you can use a backup set to restore the databases or tables. For more information, see Restore individual databases or tables for an RDS for MySQL instance.

The RDS instance on which you call this API action must meet the following conditions; otherwise, the operation fails:

  • The used DB engine version and edition are MySQL 5.7 High-availability Edition (with local SSD disks) or MySQL 5.6 High-availability Edition.
  • The instance is in Running state.
  • The instance is not involved in any ongoing migration tasks.
  • If you want to restore data by time, the log backup function is enabled.
  • The single-database and -table restoration function is enabled, and a new backup set is created.
  • The name of the restored table does not exist in the instance.

Debug

Use OpenAPI Explorer to perform debug operations and generate SDK code examples.

Request parameters

ID Type Required Example value Description
Action String Yes RestoreTable The name of this API action. Value: RestoreTable.
DBInstanceId String Yes Rm-uf6wjk5xxxxxxxxxx

The ID of the RDS instance whose single databases or tables you want to restore.

BackupId String No 9026262

The ID of the backup set that is used for data restoration.

You can call the DescribeBackups API action to obtain the list of backup sets.

Note You must enter at least one of the following two parameters: BackupId and RestoreTime.
RestoreTime String No 2011-06-11T16:00:00Z Any time point with the backup retention period. Format: yyyy-MM-ddTHH:mm:ssZ (UTC time).
Note You must enter at least one of the following two parameters: BackupId and RestoreTime.
TableMeta String No [{"type":"db","name":"testdb1","newname":"testdb1_new","tables":[{"type":"table","name":"testdb1table1","newname":"testdb1table1_new"}]}]

The information about the databases and tables you want to restore. Format:

[{"type":"db","name":"<Name of Original Database 1>","newname":"<Name of New Database 1>","tables":[{"type":"table","name":"<Name of Original Table 1 in Database 1>","newname":"<Name of New Table 1>"},{"type":"table","name":"<Name of Original Table 2 in Database 1>","newname":"<Name of New Table 2>"}]},{"type":"db","name":"<Name of Original Database 2>","newname":"<Name of New Database 2>","tables":[{"type":"table","name":"<Name of Original Table 3 in Database 2>","newname":"<Name of New Table 3>"},{"type":"table","name":"<Name of Original Table 4 in Database 2>","newname":"<Name of New Table 4>"}]}]
AccessKeyId String No LTAIfCxxxxxxx

The AccessKey ID that Alibaba Cloud issues to a user for service access.

ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxxxxx

The client token that is used to guarantee the idempotency of requests. The client token is generated by the client and is unique among different requests. It is a string of up to 64 ASCII characters.

Response elements

ID Type Example value Description
RequestId String EA2D4F34-01A7-46EB-A339-D80882135206

The ID of the request.

Examples

Request example:


http(s)://rds.aliyuncs.com/? Action=RestoreTable
&DBInstanceId=rm-uf6wjk5xxxxxxxxxx
&RestoreTime=2019-08-20T16:00:00Z
&TableMeta=[{"type":"db","name":"dtstestdata","newname":"dtstestdata","tables":[{"type":"table","name":"customer_old","newname":"customer_old123"},{"type":"table","name":"order","newname":"order123"}]}]
&<Public request parameters>

Response example:

XML format:

<RestoreTableResponse>
  <RequestId>EA2D4F34-01A7-46EB-A339-D80882135206</RequestId>
</RestoreTableResponse>

JSON format:

{
	"RequestId":"EA2D4F34-01A7-46EB-A339-D80882135206"
}

Errors

For a list of error codes, visit the API Error Center.