Managed Databases - Get

取得受控資料庫。

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

URI 參數

名稱 位於 必要 類型 Description
databaseName
path True

string

資料庫的名稱。

managedInstanceName
path True

string

受控實例的名稱。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

資源群組的名稱。 名稱不區分大小寫。

subscriptionId
path True

string (uuid)

目標訂用帳戶的標識碼。 此值必須是 UUID。

api-version
query True

string

minLength: 1

用於此作業的 API 版本。

回應

名稱 類型 Description
200 OK

ManagedDatabase

Azure 運作順利完成。

Other Status Codes

ErrorResponse

未預期的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow.

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Gets a managed database

範例要求

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

範例回覆

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

定義

名稱 Description
CatalogCollationType

元資料目錄的定序。

createdByType

建立資源的身分識別類型。

ErrorAdditionalInfo

資源管理錯誤附加資訊。

ErrorDetail

錯誤詳細資料。

ErrorResponse

錯誤回應

InaccessibilityReason

根本原因種類。 允許的值為「TransparentDataEncryption」、“DatabaseReplication”和“Unknown”。

ManagedDatabase

受控資料庫資源。

ManagedDatabaseCreateMode

受控資料庫建立模式。 PointInTimeRestore:藉由還原現有資料庫的時間點備份來建立資料庫。 必須指定SourceDatabaseName、SourceManagedInstanceName和PointInTime。 RestoreExternalBackup:從外部備份文件還原來建立資料庫。 必須指定 Collation、StorageContainerUri 和 StorageContainerSasToken。 復原:藉由還原異地復寫備份來建立資料庫。 RecoverableDatabaseId 必須指定為要還原的可復原資料庫資源標識符。 RestoreLongTermRetentionBackup:從長期保留備份還原來建立資料庫(需要 longTermRetentionBackupResourceId)。

ManagedDatabaseExtendedAccessibilityInfo

託管資料庫擴展輔助功能資訊

ManagedDatabaseStatus

資料庫的狀態。

systemData

與建立和上次修改資源相關的元數據。

CatalogCollationType

元資料目錄的定序。

值 Description
DATABASE_DEFAULT

DATABASE_DEFAULT

SQL_Latin1_General_CP1_CI_AS

SQL_Latin1_General_CP1_CI_AS

createdByType

建立資源的身分識別類型。

值 Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

資源管理錯誤附加資訊。

名稱 類型 Description
info

object

附加資訊。

type

string

其他資訊類型。

ErrorDetail

錯誤詳細資料。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤附加資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳情

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

錯誤物件。

InaccessibilityReason

根本原因種類。 允許的值為「TransparentDataEncryption」、“DatabaseReplication”和“Unknown”。

值 Description
Unknown

Unknown

TransparentDataEncryption

TransparentDataEncryption

DatabaseReplication

資料庫複製

ManagedDatabase

受控資料庫資源。

名稱 類型 Description
id

string (arm-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:從外部備份文件還原來建立資料庫。 必須指定 Collation、StorageContainerUri 和 StorageContainerSasToken。 復原:藉由還原異地復寫備份來建立資料庫。 RecoverableDatabaseId 必須指定為要還原的可復原資料庫資源標識符。 RestoreLongTermRetentionBackup:從長期保留備份還原來建立資料庫(需要 longTermRetentionBackupResourceId)。

properties.creationDate

string (date-time)

資料庫的建立日期。

properties.crossSubscriptionRestorableDroppedDatabaseId

string

建立此資料庫時,可還原的跨訂用帳戶卸除資料庫資源標識符。

properties.crossSubscriptionSourceDatabaseId

string

與此資料庫建立作業相關聯的跨訂用帳戶源資料庫資源標識符。

properties.crossSubscriptionTargetManagedInstanceId

string

目標受控實例標識碼用於跨訂用帳戶還原。

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

建立此資料庫時要還原的可還原卸除資料庫資源標識符。

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 Resource Manager 包含 createdBy 與 modifiedBy 資訊的元資料。

tags

object

資源標籤。

type

string

資源的類型。 例如:「Microsoft。運算/虛擬機器」或「Microsoft」。儲存/儲存帳號」

ManagedDatabaseCreateMode

受控資料庫建立模式。 PointInTimeRestore:藉由還原現有資料庫的時間點備份來建立資料庫。 必須指定SourceDatabaseName、SourceManagedInstanceName和PointInTime。 RestoreExternalBackup:從外部備份文件還原來建立資料庫。 必須指定 Collation、StorageContainerUri 和 StorageContainerSasToken。 復原:藉由還原異地復寫備份來建立資料庫。 RecoverableDatabaseId 必須指定為要還原的可復原資料庫資源標識符。 RestoreLongTermRetentionBackup:從長期保留備份還原來建立資料庫(需要 longTermRetentionBackupResourceId)。

值 Description
Default

預設值

RestoreExternalBackup

RestoreExternalBackup

PointInTimeRestore

PointInTimeRestore

Recovery

Recovery

RestoreLongTermRetentionBackup

恢復長期保留備份

ManagedDatabaseExtendedAccessibilityInfo

託管資料庫擴展輔助功能資訊

名稱 類型 Description
inaccessibilityReasonDescription

string

根本原因解釋和緩解措施。

inaccessibilityReasonErrorCode

string

SQL Server 錯誤代碼與無法存取的根本原因有關。

inaccessibilityReasonKind

InaccessibilityReason

根本原因種類。 允許的值為「TransparentDataEncryption」、“DatabaseReplication”和“Unknown”。

inaccessibilityReasonTdeKeyUri

string

對於根本原因類型“TransparentDataEncryption”,CMK URI。

ManagedDatabaseStatus

資料庫的狀態。

值 Description
Online

線上

Offline

離線

Shutdown

關機

Creating

建立中

Inaccessible

無法

Restoring

恢復

Updating

更新中

Stopping

停止中

Stopped

已停止

Starting

啟動中

DbMoving

DbMoving

DbCopying

資料庫複製

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
createdAt

string (date-time)

資源建立的時間戳(UTC)。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string (date-time)

資源上次修改的時間戳記 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。