通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Managed Databases - Create Or Update

创建新数据库或更新现有数据库。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}?api-version=2025-01-01

URI 参数

名称 必需 类型 说明
databaseName
path True

string

数据库的名称。

managedInstanceName
path True

string

托管实例的名称。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求正文

名称 必需 类型 说明
location True

string

资源所在的地理位置

properties.autoCompleteRestore

boolean

是否自动完成此托管数据库的还原。

properties.catalogCollation

CatalogCollationType

元数据目录的排序规则。

properties.collation

string

托管数据库的排序规则。

properties.createMode

ManagedDatabaseCreateMode

托管数据库创建模式。 PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 必须指定 SourceDatabaseName、SourceManagedInstanceName 和 PointInTime。 RestoreExternalBackup:通过从外部备份文件还原来创建数据库。 必须指定排序规则、StorageContainerUri 和 StorageContainerSasToken。 恢复:通过还原异地复制的备份来创建数据库。 RecoverableDatabaseId 必须指定为可恢复的数据库资源 ID 才能还原。 RestoreLongTermRetentionBackup:通过从长期保留备份(需要 longTermRetentionBackupResourceId)还原来创建数据库。

properties.crossSubscriptionRestorableDroppedDatabaseId

string

可还原的跨订阅删除的数据库资源 ID,用于在创建此数据库时还原。

properties.crossSubscriptionSourceDatabaseId

string

与此数据库的创建作关联的跨订阅源数据库的资源标识符。

properties.crossSubscriptionTargetManagedInstanceId

string

跨订阅还原中使用的目标托管实例 ID。

properties.isLedgerOn

boolean

此数据库是否为账本数据库,这意味着数据库中的所有表都是账本表。 注意:创建数据库后,无法更改此属性的值。

properties.lastBackupName

string

用于还原此托管数据库的上次备份文件名。

properties.longTermRetentionBackupResourceId

string

要用于还原此托管数据库的长期保留备份的名称。

properties.recoverableDatabaseId

string

与此数据库的创建作关联的可恢复数据库的资源标识符。

properties.restorableDroppedDatabaseId

string

创建此数据库时要还原的可还原删除的数据库资源 ID。

properties.restorePointInTime

string (date-time)

Conditional. 如果 createMode 为 PointInTimeRestore,则此值是必需的。 指定将还原以创建新数据库的源数据库的时间点(ISO8601格式)。

properties.sourceDatabaseId

string

与此数据库的创建作关联的源数据库的资源标识符。

properties.storageContainerIdentity

string

Conditional. 如果 createMode 为 RestoreExternalBackup,则使用此值。 指定用于存储容器身份验证的标识。 可以是“SharedAccessSignature”或“ManagedIdentity”;如果未指定“SharedAccessSignature”,则假定为

properties.storageContainerSasToken

string

Conditional. 如果 createMode 为 RestoreExternalBackup 且 storageContainerIdentity 不是 ManagedIdentity,则此值是必需的。 指定存储容器 sas 令牌。

properties.storageContainerUri

string

Conditional. 如果 createMode 为 RestoreExternalBackup,则此值是必需的。 指定存储容器的 URI,用于存储此还原的备份。

tags

object

资源标记。

响应

名称 类型 说明
200 OK

ManagedDatabase

资源“ManagedDatabase”更新操作成功

201 Created

ManagedDatabase

资源“ManagedDatabase”创建操作成功

标头

  • Location: string
  • Retry-After: integer
202 Accepted

已接受资源作。

标头

  • Location: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

意外的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow.

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Creates a new managed database by restoring from an external backup
Creates a new managed database by restoring from an external backup using managed identity
Creates a new managed database from restoring a geo-replicated backup
Creates a new managed database from restoring a long term retention backup
Creates a new managed database using cross subscription point in time restore
Creates a new managed database using point in time restore
Creates a new managed database with ledger on.
Creates a new managed database with maximal properties
Creates a new managed database with minimal properties

Creates a new managed database by restoring from an external backup

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2025-01-01

{
  "location": "southeastasia",
  "properties": {
    "autoCompleteRestore": true,
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "createMode": "RestoreExternalBackup",
    "lastBackupName": "last_backup_name",
    "storageContainerSasToken": "sv=2015-12-11&sr=c&sp=rl&sig=1234",
    "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups"
  }
}

示例响应

{
  "name": "testdb1",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
{
  "name": "testdb2",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}

Creates a new managed database by restoring from an external backup using managed identity

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2025-01-01

{
  "location": "southeastasia",
  "properties": {
    "autoCompleteRestore": true,
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "createMode": "RestoreExternalBackup",
    "lastBackupName": "last_backup_name",
    "storageContainerIdentity": "ManagedIdentity",
    "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups"
  }
}

示例响应

{
  "name": "testdb1",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
{
  "name": "testdb2",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}

Creates a new managed database from restoring a geo-replicated backup

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/server1/databases/testdb_recovered?api-version=2025-01-01

{
  "location": "southeastasia",
  "properties": {
    "createMode": "Recovery",
    "recoverableDatabaseId": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-WestEurope/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb"
  }
}

示例响应

{
  "name": "testdb_recovered",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/server1/recoverableDatabases/testdb_recovered",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2018-11-07T04:41:33.937Z",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
{
  "name": "testdb_recovered",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb_recovered",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2018-11-07T04:41:33.937Z",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}

Creates a new managed database from restoring a long term retention backup

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2025-01-01

{
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "createMode": "RestoreExternalBackup",
    "storageContainerSasToken": "sv=2015-12-11&sr=c&sp=rl&sig=1234",
    "storageContainerUri": "https://myaccountname.blob.core.windows.net/backups"
  }
}

示例响应

{
  "name": "testdb1",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
{
  "name": "testdb2",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}

Creates a new managed database using cross subscription point in time restore

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2025-01-01

{
  "location": "southeastasia",
  "properties": {
    "createMode": "PointInTimeRestore",
    "crossSubscriptionSourceDatabaseId": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr2/databases/testdb",
    "crossSubscriptionTargetManagedInstanceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr",
    "restorePointInTime": "2017-07-14T05:35:31.503Z"
  }
}

示例响应

{
  "name": "testdb1",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
{
  "name": "testdb2",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}

Creates a new managed database using point in time restore

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2025-01-01

{
  "location": "southeastasia",
  "properties": {
    "createMode": "PointInTimeRestore",
    "restorePointInTime": "2017-07-14T05:35:31.503Z",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb"
  }
}

示例响应

{
  "name": "testdb1",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
{
  "name": "testdb2",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}

Creates a new managed database with ledger on.

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2025-01-01

{
  "location": "southeastasia",
  "properties": {
    "isLedgerOn": true
  }
}

示例响应

{
  "name": "testdb1",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb1",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": true,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
{
  "name": "testdb2",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb2",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": true,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/locations/southeastasia/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2022-08-01

Creates a new managed database with maximal properties

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2025-01-01

{
  "location": "southeastasia",
  "tags": {
    "tagKey1": "TagValue1"
  }
}

示例响应

{
  "name": "testdb1",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
{
  "name": "testdb2",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  },
  "tags": {
    "tagKey1": "TagValue1"
  }
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/locations/southeastasia/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2017-03-01

Creates a new managed database with minimal properties

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/managedDatabase?api-version=2025-01-01

{
  "location": "southeastasia"
}

示例响应

{
  "name": "testdb1",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb1",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  }
}
{
  "name": "testdb2",
  "type": "Microsoft.Sql/managedInstances/databases",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/databases/testdb2",
  "location": "southeastasia",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "defaultSecondaryLocation": "North Europe",
    "isLedgerOn": false,
    "status": "Online"
  }
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/locations/southeastasia/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2017-03-01

定义

名称 说明
CatalogCollationType

元数据目录的排序规则。

createdByType

创建资源的标识的类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

InaccessibilityReason

根本原因种类。 允许的值为“TransparentDataEncryption”、“DatabaseReplication”和“Unknown”。

ManagedDatabase

托管数据库资源。

ManagedDatabaseCreateMode

托管数据库创建模式。 PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 必须指定 SourceDatabaseName、SourceManagedInstanceName 和 PointInTime。 RestoreExternalBackup:通过从外部备份文件还原来创建数据库。 必须指定排序规则、StorageContainerUri 和 StorageContainerSasToken。 恢复:通过还原异地复制的备份来创建数据库。 RecoverableDatabaseId 必须指定为可恢复的数据库资源 ID 才能还原。 RestoreLongTermRetentionBackup:通过从长期保留备份(需要 longTermRetentionBackupResourceId)还原来创建数据库。

ManagedDatabaseExtendedAccessibilityInfo

托管数据库扩展辅助功能信息

ManagedDatabaseStatus

数据库的状态。

systemData

与创建和上次修改资源相关的元数据。

CatalogCollationType

元数据目录的排序规则。

说明
DATABASE_DEFAULT

DATABASE_DEFAULT

SQL_Latin1_General_CP1_CI_AS

SQL_Latin1_General_CP1_CI_AS

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

附加信息。

type

string

附加信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

InaccessibilityReason

根本原因种类。 允许的值为“TransparentDataEncryption”、“DatabaseReplication”和“Unknown”。

说明
Unknown

未知

TransparentDataEncryption

TransparentDataEncryption

DatabaseReplication

数据库复制

ManagedDatabase

托管数据库资源。

名称 类型 说明
id

string (arm-id)

资源的完全限定资源 ID。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

location

string

资源所在的地理位置

name

string

资源的名称

properties.autoCompleteRestore

boolean

是否自动完成此托管数据库的还原。

properties.catalogCollation

CatalogCollationType

元数据目录的排序规则。

properties.collation

string

托管数据库的排序规则。

properties.createMode

ManagedDatabaseCreateMode

托管数据库创建模式。 PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 必须指定 SourceDatabaseName、SourceManagedInstanceName 和 PointInTime。 RestoreExternalBackup:通过从外部备份文件还原来创建数据库。 必须指定排序规则、StorageContainerUri 和 StorageContainerSasToken。 恢复:通过还原异地复制的备份来创建数据库。 RecoverableDatabaseId 必须指定为可恢复的数据库资源 ID 才能还原。 RestoreLongTermRetentionBackup:通过从长期保留备份(需要 longTermRetentionBackupResourceId)还原来创建数据库。

properties.creationDate

string (date-time)

数据库的创建日期。

properties.crossSubscriptionRestorableDroppedDatabaseId

string

可还原的跨订阅删除的数据库资源 ID,用于在创建此数据库时还原。

properties.crossSubscriptionSourceDatabaseId

string

与此数据库的创建作关联的跨订阅源数据库的资源标识符。

properties.crossSubscriptionTargetManagedInstanceId

string

跨订阅还原中使用的目标托管实例 ID。

properties.defaultSecondaryLocation

string

地理配对区域。

properties.earliestRestorePoint

string (date-time)

时间点还原的最早还原点。

properties.extendedAccessibilityInfo

ManagedDatabaseExtendedAccessibilityInfo

处于“不可访问”状态的数据库的其他可观测性和故障排除信息。

properties.failoverGroupId

string

此托管数据库所属的实例故障转移组资源标识符。

properties.isLedgerOn

boolean

此数据库是否为账本数据库,这意味着数据库中的所有表都是账本表。 注意:创建数据库后,无法更改此属性的值。

properties.lastBackupName

string

用于还原此托管数据库的上次备份文件名。

properties.longTermRetentionBackupResourceId

string

要用于还原此托管数据库的长期保留备份的名称。

properties.recoverableDatabaseId

string

与此数据库的创建作关联的可恢复数据库的资源标识符。

properties.restorableDroppedDatabaseId

string

创建此数据库时要还原的可还原删除的数据库资源 ID。

properties.restorePointInTime

string (date-time)

Conditional. 如果 createMode 为 PointInTimeRestore,则此值是必需的。 指定将还原以创建新数据库的源数据库的时间点(ISO8601格式)。

properties.sourceDatabaseId

string

与此数据库的创建作关联的源数据库的资源标识符。

properties.status

ManagedDatabaseStatus

数据库的状态。

properties.storageContainerIdentity

string

Conditional. 如果 createMode 为 RestoreExternalBackup,则使用此值。 指定用于存储容器身份验证的标识。 可以是“SharedAccessSignature”或“ManagedIdentity”;如果未指定“SharedAccessSignature”,则假定为

properties.storageContainerSasToken

string

Conditional. 如果 createMode 为 RestoreExternalBackup 且 storageContainerIdentity 不是 ManagedIdentity,则此值是必需的。 指定存储容器 sas 令牌。

properties.storageContainerUri

string

Conditional. 如果 createMode 为 RestoreExternalBackup,则此值是必需的。 指定存储容器的 URI,用于存储此还原的备份。

systemData

systemData

Azure 资源管理器 包含 createdBy 和 modifiedBy 信息的元数据。

tags

object

资源标记。

type

string

资源类型。 例如,“Microsoft。计算/虚拟机“或”Microsoft“。存储/存储账户”

ManagedDatabaseCreateMode

托管数据库创建模式。 PointInTimeRestore:通过还原现有数据库的时间点备份来创建数据库。 必须指定 SourceDatabaseName、SourceManagedInstanceName 和 PointInTime。 RestoreExternalBackup:通过从外部备份文件还原来创建数据库。 必须指定排序规则、StorageContainerUri 和 StorageContainerSasToken。 恢复:通过还原异地复制的备份来创建数据库。 RecoverableDatabaseId 必须指定为可恢复的数据库资源 ID 才能还原。 RestoreLongTermRetentionBackup:通过从长期保留备份(需要 longTermRetentionBackupResourceId)还原来创建数据库。

说明
Default

默认

RestoreExternalBackup

恢复外部备份

PointInTimeRestore

PointInTimeRestore

Recovery

恢复

RestoreLongTermRetentionBackup

恢复长期保留备份

ManagedDatabaseExtendedAccessibilityInfo

托管数据库扩展辅助功能信息

名称 类型 说明
inaccessibilityReasonDescription

string

根本原因解释和缓解措施。

inaccessibilityReasonErrorCode

string

SQL Server 错误代码与无法访问的根本原因有关。

inaccessibilityReasonKind

InaccessibilityReason

根本原因种类。 允许的值为“TransparentDataEncryption”、“DatabaseReplication”和“Unknown”。

inaccessibilityReasonTdeKeyUri

string

对于根本原因类型“TransparentDataEncryption”,CMK URI。

ManagedDatabaseStatus

数据库的状态。

说明
Online

在线

Offline

离线

Shutdown

关机

Creating

创建

Inaccessible

无法

Restoring

恢复

Updating

更新

Stopping

正在停止

Stopped

已停止

Starting

正在启动

DbMoving

DbMoving

DbCopying

数据库复制

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

资源上次修改的时间戳 (UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。