Get Database (classic)

 

Updated: October 5, 2016

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

Gets the details for 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 Get Database request must be specified as follows:

  • Replace {subscriptionId} with your subscription ID.

  • Replace {serverName} with the name of the server containing the database whose details you want.

  • Replace {databaseName} with the name of the database you want to inspect.

MethodRequest URIHTTP Version
GEThttps://management.core.windows.net:8443/{subscriptionId}/services/sqlservers/servers/{serverName}/databases/{databaseName}HTTP/1.1

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.

Request Body

None.

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

Status Code

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>MyDatabase</Name>  
  <Type>Microsoft.SqlAzure.Database</Type>  
  <State>Normal</State>  
  <SelfLink>http://asdf/servers/xbi75mhqni/databases/MyWebDatabase</SelfLink>  
  <ParentLink>http://asdf/servers/xbi75mhqni</ParentLink>  
  <Id>4</Id>  
  <Edition>Basic</Edition>  
  <MaxSizeGB>1</MaxSizeGB>  
  <CollationName>SQL_Latin1_General_CP1_CI_AS</CollationName>  
  <CreationDate>2014-04-16T01:56:00.3600000Z</CreationDate>  
  <IsFederationRoot>False</IsFederationRoot>  
  <IsSystemObject>False</IsSystemObject>  
  <SizeMB i:nil="true"/>  
  <MaxSizeBytes>1073741824</MaxSizeBytes>  
  <ServiceObjectiveId>dd6d99bb-f193-4ec1-86f2-43d3bccbc49c</ServiceObjectiveId>  
  <AssignedServiceObjectiveId>dd6d99bb-f193-4ec1-86f2-43d3bccbc49c</AssignedServiceObjectiveId>  
  <ServiceObjectiveAssignmentState>1</ServiceObjectiveAssignmentState>  
  <ServiceObjectiveAssignmentStateDescription>Complete</ServiceObjectiveAssignmentStateDescription>  
  <ServiceObjectiveAssignmentErrorCode>0</ServiceObjectiveAssignmentErrorCode>  
  <ServiceObjectiveAssignmentErrorDescription i:nil="true"/>  
  <ServiceObjectiveAssignmentSuccessDate>2014-04-16T01:56:48.2400000Z</ServiceObjectiveAssignmentSuccessDate>  
  <RecoveryPeriodStartDate i:nil="true"/>  
</ServiceResource>  

The following table describes the elements of the response body:

NameThe name of the database to retrieve.
TypeThe type of the resource. A database will be Microsoft.SqlAzure.Database.
StateThe state of the service resource.
SelfLinkThe URI for this service resource.
ParentLinkThe URI for the parent service resource.
IdThe database ID. Each database in a server has a unique ID.
EditionThe current edition of the database. If the edition was changed during an update, this will be the old value until any pending Service Level Objective (SLO) assignments are completed. For edition changes that don’t require a SLO change, this will be the new edition.
MaxSizeGBThe maximum size of the database in gigabytes.
CollationNameThe name of the database collation.
CreationDateThe date and time this database was created.
IsFederationRootSpecifies if this database is the federation root.
IsSystemObjectSpecifies if this database is a system object. Master database is an example of a system object.
SizeMbThe currently used size of the database in megabytes.
MaxSizeBytesThe maximum size of the database expressed in bytes.
ServiceObjectiveIdThe currently assigned and active service objective ID. If a SLO change is in progress or pending, this will be the SLO before the update was applied.

To know which GUID to use in ServiceObjectiveId, see List Service Level Objectives (classic) find the ID of the service that you want, and locate the GUID for that service.
AssignedServiceObjectiveIdThe currently assigned service objective ID. If a SLO change is in progress or pending this will be the new SLO that is assigned to the database.
ServiceObjectiveAssignmentStateAn integer representing the current state of the service objective assignment operation. 1 is complete and 0 is pending.
ServiceObjectiveAssignementStateDescriptionThe current state of the service objective assignment. Pending means the database is currently transitioning from one Service Objective to another. Complete means that the service objective assignment completed successfully.
ServiceObjectiveAssignmentErrorCodeIf there was an error assigning the service objective to the database, this will contain the error code.
ServiceObjectiveAssignmentErrorDescriptionThe description for the error, if there was an error.
ServiceObjectiveAssignmentSuccessDateThe date and time that the service objective was successfully applied to the database.
RecoveryPeriodStartDateThe starting date for when database recovery is available.

Restore an Azure SQL database using Point in Time Restore with REST API
Common REST API Error Codes
Azure SQL Database
Operations for Azure SQL Databases
Azure SQL Database Cmdlets
Get-AzureSqlDatabase

Show: