Create Database Recovery Request (classic)

 

Updated: October 5, 2016

THIS TOPIC APPLIES TO: noSQL Server yesAzure SQL DatabaseyesAzure SQL Data Warehouse noParallel Data Warehouse

Recover an Azure SQL Database.

This command uses the classic deployment model. You should use the newer Resource Manager based REST API commands located here. For more information, see Azure Resource Manager vs. classic deployment: Understand deployment models and the state of your resources.

The Create Database Recovery Request must be specified as follows:

  • Replace {subscriptionId} with your subscription ID.

  • Replace {sourceServerName} with the server name where the recoverable database is located.

MethodRequest URIHTTP Version
POSThttps://management.core.windows.net:8443/{subscriptionId}/servers/{sourceServerName}/recoverdatabaseoperationsHTTP/1.1

The time to recover a database will vary depending on the size and attributes of the specific database. Use Database Operation Status (classic) to check the status of a recovery operation.

URI Parameters

None.

Request Headers

The following table describes the required and optional request headers:

Request HeaderDescription
x-ms-versionRequired. Specifies the version of the operation to use for this request. This header should be set to 2012-03-01.
x-ms-client-request-idOptional. Provides a client-generated, opaque value with a 1 KB character limit. Using this header is highly recommended for correlating client-side activities with requests received by the server.

Request Body

The format of the request body is as follows:

<ServiceResource xmlns="http://schemas.microsoft.com/windowsazure">  
   <SourceDatabaseName>sourceDB</SourceDatabaseName>  
   <TargetServerName>targetServer</TargetServerName>  
   <TargetDatabaseName>targetDB</TargetDatabaseName>  
</ServiceResource>  
  

The following table describes the elements of the request body:

Element NameDescription
SourceDatabaseNameThe name of the database to recover.
TargetServerNameThe name of the server to recover the database to.
TargetDatabaseNameThe name of the database to recover to.
System_CAPS_ICON_note.jpg Note


The TargetDatabaseName must not be the name of a live database already on the server. The {sourceDatabaseName} and {targetDatabaseName} should not use system reserved names, such as master, tempdb, model, msdb, for example.

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

Response status code 201 (Created) indicates the request succeeded.

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response HeaderDescription
x-ms-request-idA value that uniquely identifies a request made against the database management service. This request id is used for request tracking. If a failure occurs that requires the user to contact Microsoft Support, the request id should be provided to Microsoft to assist in tracking and resolving the failure for the request.

Response Body

The following is an example response body:

<ServiceResource xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <Name i:nil="true" />  
  <Type>Microsoft.SqlAzure.RecoverDatabaseOperation</Type>  
  <State>Created</State>  
  <SelfLink i:nil="true" />  
  <ParentLink i:nil="true" />  
  <RequestID>a6966e0d-4e27-47d9-85f6-c5a9c1cc2264</RequestID>  
  <SourceDatabaseName>recoverableDBName</SourceDatabaseName>  
  <TargetServerName>servername</TargetServerName>  
  <TargetDatabaseName>RecoveredDBName</TargetDatabaseName>  
</ServiceResource>  
  

The following table describes the elements in the response body:

Element NameDescription
SourceDatabaseNameThe name of the database being recovered.
TargetServerNameThe name of the server where the database will be recovered to.
TargetDatabaseNameThe name for the recovered database.

To check if a specific database is available for recovery, see Get Recoverable Database (classic). For a complete list of databases that can be recovered, see List Recoverable Databases (classic).

Recover an Azure SQL database using Geo-Restore with REST API
Common REST API Error Codes
Azure SQL Database
Operations for Azure SQL Databases
Azure SQL Database Cmdlets
Start-AzureSqlDatabaseRecovery

Show: