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

Managed Databases - List By Instance

获取托管数据库的列表。

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

URI 参数

名称 必需 类型 说明
managedInstanceName
path True

string

托管实例的名称。

resourceGroupName
path True

string

包含该资源的资源组名称。 可以从 Azure 资源管理器 API 或门户获取此值。

subscriptionId
path True

string

用于标识 Azure 订阅的订阅 ID。

api-version
query True

string

要用于请求的 API 版本。

响应

名称 类型 说明
200 OK

ManagedDatabaseListResult

已成功检索数据库列表。

Other Status Codes

错误响应:***

  • 404 SubscriptionDoesNotHaveServer - 找不到请求的服务器

  • 404 ServerNotInSubscriptionResourceGroup - 指定的服务器不存在于指定的资源组和订阅中。

示例

List databases by managed instances

Sample Request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Test1/providers/Microsoft.Sql/managedInstances/managedInstance/databases?api-version=2021-11-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb1",
      "location": "southeastasia",
      "name": "testdb1",
      "properties": {
        "collation": "SQL_Latin1_General_CP1_CI_AS",
        "creationDate": "2017-08-04T15:00:17.73Z",
        "defaultSecondaryLocation": "North Europe",
        "status": "Online"
      },
      "type": "Microsoft.Sql/managedInstances/databases"
    },
    {
      "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/databases/testdb2",
      "location": "southeastasia",
      "name": "testdb2",
      "properties": {
        "collation": "SQL_Latin1_General_CP1_CI_AS",
        "creationDate": "2017-08-04T15:00:17.73Z",
        "defaultSecondaryLocation": "North Europe",
        "status": "Online"
      },
      "type": "Microsoft.Sql/managedInstances/databases"
    }
  ]
}

定义

名称 说明
CatalogCollationType

元数据目录的排序规则。

ManagedDatabase

托管数据库资源。

ManagedDatabaseCreateMode

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

ManagedDatabaseListResult

托管数据库的列表。

ManagedDatabaseStatus

数据库的状态。

CatalogCollationType

元数据目录的排序规则。

名称 类型 说明
DATABASE_DEFAULT

string

SQL_Latin1_General_CP1_CI_AS

string

ManagedDatabase

托管数据库资源。

名称 类型 说明
id

string

资源 ID。

location

string

资源位置。

name

string

资源名称。

properties.autoCompleteRestore

boolean

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

properties.catalogCollation

CatalogCollationType

元数据目录的排序规则。

properties.collation

string

托管数据库的排序规则。

properties.createMode

ManagedDatabaseCreateMode

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

properties.creationDate

string

数据库的创建日期。

properties.defaultSecondaryLocation

string

地理配对区域。

properties.earliestRestorePoint

string

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

properties.failoverGroupId

string

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

properties.lastBackupName

string

用于还原此托管数据库的最后一个备份文件名。

properties.longTermRetentionBackupResourceId

string

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

properties.recoverableDatabaseId

string

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

properties.restorableDroppedDatabaseId

string

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

properties.restorePointInTime

string

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

properties.sourceDatabaseId

string

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

properties.status

ManagedDatabaseStatus

数据库的状态。

properties.storageContainerSasToken

string

条件。 如果 createMode 为 RestoreExternalBackup,则此值是必需的。 指定存储容器 sas 令牌。

properties.storageContainerUri

string

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

tags

object

资源标记。

type

string

资源类型。

ManagedDatabaseCreateMode

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

名称 类型 说明
Default

string

PointInTimeRestore

string

Recovery

string

RestoreExternalBackup

string

RestoreLongTermRetentionBackup

string

ManagedDatabaseListResult

托管数据库的列表。

名称 类型 说明
nextLink

string

用于检索下一页结果的链接。

value

ManagedDatabase[]

结果数组。

ManagedDatabaseStatus

数据库的状态。

名称 类型 说明
Creating

string

Inaccessible

string

Offline

string

Online

string

Restoring

string

Shutdown

string

Updating

string