Managed Databases - Update
Updates an existing database.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}?api-version=2021-11-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
database
|
path | True |
string |
The name of the database. |
managed
|
path | True |
string |
The name of the managed instance. |
resource
|
path | True |
string |
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
api-version
|
query | True |
string |
The API version to use for the request. |
Request Body
Name | Type | Description |
---|---|---|
properties.autoCompleteRestore |
boolean |
Whether to auto complete restore of this managed database. |
properties.catalogCollation |
Collation of the metadata catalog. |
|
properties.collation |
string |
Collation of the managed database. |
properties.createMode |
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). |
|
properties.lastBackupName |
string |
Last backup file name for restore of this managed database. |
properties.longTermRetentionBackupResourceId |
string |
The name of the Long Term Retention backup to be used for restore of this managed database. |
properties.recoverableDatabaseId |
string |
The resource identifier of the recoverable database associated with create operation of this database. |
properties.restorableDroppedDatabaseId |
string |
The restorable dropped database resource id to restore when creating this database. |
properties.restorePointInTime |
string |
Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. |
properties.sourceDatabaseId |
string |
The resource identifier of the source database associated with create operation of this database. |
properties.storageContainerSasToken |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token. |
properties.storageContainerUri |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. |
tags |
object |
Resource tags. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Successfully updated the database. |
|
202 Accepted |
Updating the managed database is in progress. |
|
Other Status Codes |
*** Error Responses: ***
|
Examples
Updates a managed database with maximal properties |
Updates a managed database with minimal properties |
Updates a managed database with maximal properties
Sample request
Sample response
{
"tags": {
"tagKey1": "TagValue1"
},
"location": "southeastasia",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
"name": "testdb"
}
Updates a managed database with minimal properties
Sample request
Sample response
{
"tags": {
"tagKey1": "TagValue1"
},
"location": "southeastasia",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
"name": "testdb"
}
Definitions
Name | Description |
---|---|
Catalog |
Collation of the metadata catalog. |
Managed |
A managed database resource. |
Managed |
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). |
Managed |
Status of the database. |
Managed |
An managed database update. |
CatalogCollationType
Collation of the metadata catalog.
Name | Type | Description |
---|---|---|
DATABASE_DEFAULT |
string |
|
SQL_Latin1_General_CP1_CI_AS |
string |
ManagedDatabase
A managed database resource.
Name | Type | Description |
---|---|---|
id |
string |
Resource ID. |
location |
string |
Resource location. |
name |
string |
Resource name. |
properties.autoCompleteRestore |
boolean |
Whether to auto complete restore of this managed database. |
properties.catalogCollation |
Collation of the metadata catalog. |
|
properties.collation |
string |
Collation of the managed database. |
properties.createMode |
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). |
|
properties.creationDate |
string |
Creation date of the database. |
properties.defaultSecondaryLocation |
string |
Geo paired region. |
properties.earliestRestorePoint |
string |
Earliest restore point in time for point in time restore. |
properties.failoverGroupId |
string |
Instance Failover Group resource identifier that this managed database belongs to. |
properties.lastBackupName |
string |
Last backup file name for restore of this managed database. |
properties.longTermRetentionBackupResourceId |
string |
The name of the Long Term Retention backup to be used for restore of this managed database. |
properties.recoverableDatabaseId |
string |
The resource identifier of the recoverable database associated with create operation of this database. |
properties.restorableDroppedDatabaseId |
string |
The restorable dropped database resource id to restore when creating this database. |
properties.restorePointInTime |
string |
Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. |
properties.sourceDatabaseId |
string |
The resource identifier of the source database associated with create operation of this database. |
properties.status |
Status of the database. |
|
properties.storageContainerSasToken |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token. |
properties.storageContainerUri |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. |
tags |
object |
Resource tags. |
type |
string |
Resource type. |
ManagedDatabaseCreateMode
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required).
Name | Type | Description |
---|---|---|
Default |
string |
|
PointInTimeRestore |
string |
|
Recovery |
string |
|
RestoreExternalBackup |
string |
|
RestoreLongTermRetentionBackup |
string |
ManagedDatabaseStatus
Status of the database.
Name | Type | Description |
---|---|---|
Creating |
string |
|
Inaccessible |
string |
|
Offline |
string |
|
Online |
string |
|
Restoring |
string |
|
Shutdown |
string |
|
Updating |
string |
ManagedDatabaseUpdate
An managed database update.
Name | Type | Description |
---|---|---|
properties.autoCompleteRestore |
boolean |
Whether to auto complete restore of this managed database. |
properties.catalogCollation |
Collation of the metadata catalog. |
|
properties.collation |
string |
Collation of the managed database. |
properties.createMode |
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). |
|
properties.creationDate |
string |
Creation date of the database. |
properties.defaultSecondaryLocation |
string |
Geo paired region. |
properties.earliestRestorePoint |
string |
Earliest restore point in time for point in time restore. |
properties.failoverGroupId |
string |
Instance Failover Group resource identifier that this managed database belongs to. |
properties.lastBackupName |
string |
Last backup file name for restore of this managed database. |
properties.longTermRetentionBackupResourceId |
string |
The name of the Long Term Retention backup to be used for restore of this managed database. |
properties.recoverableDatabaseId |
string |
The resource identifier of the recoverable database associated with create operation of this database. |
properties.restorableDroppedDatabaseId |
string |
The restorable dropped database resource id to restore when creating this database. |
properties.restorePointInTime |
string |
Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. |
properties.sourceDatabaseId |
string |
The resource identifier of the source database associated with create operation of this database. |
properties.status |
Status of the database. |
|
properties.storageContainerSasToken |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token. |
properties.storageContainerUri |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. |
tags |
object |
Resource tags. |