Restores the databases or tables of an ApsaraDB for RDS instance.

If your ApsaraDB for RDS instance runs MySQL, you can restore its individual databases and tables by using backups. For more information, see Restore individual databases or tables for an RDS for MySQL instance.

Before you call this operation, make sure that the following requirements are met:

  • The RDS instance runs MySQL 5.7 in the High-availability Edition with local SSDs or runs MySQL 5.6 in the High-availability Edition.
  • The RDS instance is in the Running state.
  • The RDS instance is not performing a migration task.
  • If you want to restore data from a specific point in time, the log backup function is enabled.
  • The individual database and table restoration function is enabled, and new backups are created.
  • The names you want to use for the restored tables do not exist in the RDS instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes RestoreTable

The operation that you want to perform. Set the value to RestoreTable.

DBInstanceId String Yes rm-uf6wjk5xxxxxxxxxx

The ID of the RDS instance.

TableMeta String Yes [{"type":"db","name":"testdb1","newname":"testdb1_new","tables":[{"type":"table","name":"testdb1table1","newname":"testdb1table1_new"}]}]

The database and tables you want to restore. Format:

[{"type":"db","name":"<The original name of Database 1>","newname":"<The new name of Database 1>","tables":[{"type":"table","name":"<The original name of Table 1 in Database 1>","newname":"<The new name of Table 1 in Database 1>"},{"type":"table","name":"<The original name of Table 2 in Database 1>","newname":"<The new name of Table 2 in Database 1>"}]},{"type":"db","name":"<The original name of Database 2>","newname":"<The new name of Database 2>","tables":[{"type":"table","name":"<The original name of Table 3 in Database 2>","newname":"<The new name of Table 3 in Database 2>"},{"type":"table","name":"<The original name of Table 4 in Database 2>","newname":"<The new name of Table 4 in Database 2>"}]}]
BackupId String No 9026262

The ID of the backup set you want to use.

You can call the DescribeBackups operation to obtain the most recent backup set list.

Note You must specify either the BackupId or RestoreTime parameter.
RestoreTime String No 2011-06-11T16:00:00Z

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

Note
  • You must specify either the BackupId or RestoreTime parameter.
  • You must enable the log backup function.
AccessKeyId String No LTAIfCxxxxxxx

The AccessKey ID provided to you by Alibaba Cloud.

ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxxxxx

The client token that is used to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

Response parameters

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

The ID of the request.

Examples

Sample requests


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"}]}]
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

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