You can call the CreateTempDBInstance operation to create a temporary instance.
You can create a temporary instance based on a backup file or a point in time within the past seven days.
Before you call this operation, make sure that the following requirements are met:
- Your instance runs SQL Server 2008 R2.
- Your instance is in the Running state.
- Your instance does not have ongoing migration tasks.
- The last creation of a backup file is completed.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateTempDBInstance |
The operation that you want to perform. Set the value to CreateTempDBInstance. |
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxx |
The ID of the instance. |
BackupId | Integer | No | 603524168 |
The ID of the backup file. Note You must specify the BackupId or RestoreTime parameter.
|
RestoreTime | String | No | 2011-06-11T16:00:00Z |
The specified point in time within the 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. Note
|
ResourceGroupId | String | No | rg-acfmy***** |
The ID of the resource group. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
TempDBInstanceId | String | sub138xxxxx_rm-xxxxx |
The ID of the temporary instance. |
RequestId | String | 248DE93F-8647-4B9D-8287-4A4A0FE56AD5 |
The ID of the request. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=CreateTempDBInstance
&DBInstanceId=rm-uf6wjk5xxxxxxx
&BackupId=603524168
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateTempDBInstanceResponse>
<RequestId>248DE93F-8647-4B9D-8287-4A4A0FE56AD5</RequestId>
<TempDBInstanceId>sub138xxxxx_juxxxxx</TempDBInstanceId>
</CreateTempDBInstanceResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "248DE93F-8647-4B9D-8287-4A4A0FE56AD5",
"TempDBInstanceId" : "sub138xxxxx_juxxxxx"
}
Error codes
HTTP statua code | Error code | Error message | Description |
---|---|---|---|
400 | OperationDenied.DBInstanceStatus | The operation is not permitted due to status of instance. | The error message returned because the operation is not supported when the instance is in the current state. |
403 | OperationDenied.TempDBInstanceExists | The operation is not permitted due to temp instance exist. | The error message returned because the operation is not supported when a temporary instance has been created for the current instance. |
404 | InvalidDBInstanceName.NotFound | The specified db instance is not found. | The error message returned because the operation is not supported when the instance does not exist. |
For a list of error codes, visit the API Error Center.