Get-AzSqlInstanceDatabase
傳回 Azure SQL 受控實例資料庫的相關信息。
語法
Get-AzSqlInstanceDatabase
[[-Name] <String>]
[-InstanceName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzSqlInstanceDatabase
[[-Name] <String>]
[-InstanceResourceId] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzSqlInstanceDatabase
[[-Name] <String>]
[-InstanceObject] <AzureSqlManagedInstanceModel>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzSqlInstanceDatabase Cmdlet 會從 Azure SQL 受控實例取得一或多個 Azure SQL 資料庫。
範例
範例 1:取得實例上的所有資料庫
Get-AzSqlInstanceDatabase -InstanceName "managedInstance1" -ResourceGroupName "resourcegroup01"
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase1
Name : managedDatabase1
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/27/2018 2:30:07 PM
EarliestRestorePoint : 4/27/2018 2:40:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase2
Name : managedDatabase2
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/23/2018 5:21:07 PM
EarliestRestorePoint : 4/23/2018 5:31:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
此命令會取得實例上名為managedInstance1的所有資料庫。
範例 2:依名稱取得受控實例上的資料庫
Get-AzSqlInstanceDatabase -Name "managedDatabase1" -InstanceName "managedInstance1" -ResourceGroupName "ResourceGroup01"
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase1
Name : managedDatabase1
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/27/2018 2:30:07 PM
EarliestRestorePoint : 4/27/2018 2:40:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
此命令會從名為managedInstance1的實例取得名為managedDatabase1的資料庫。
範例 3:使用篩選取得實例上的所有資料庫
Get-AzSqlInstanceDatabase -InstanceName "managedInstance1" -ResourceGroupName "resourcegroup01" -Name "managedDatabase*"
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase1
Name : managedDatabase1
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/27/2018 2:30:07 PM
EarliestRestorePoint : 4/27/2018 2:40:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
ResourceGroupName : resourcegroup01
ManagedInstanceName : managedInstance1
Location : westcentralus
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/managedDatabase2
Name : managedDatabase2
Tags :
Collation : SQL_Latin1_General_CP1_CI_AS
Status : Online
CreationDate : 4/23/2018 5:21:07 PM
EarliestRestorePoint : 4/23/2018 5:31:47 PM
RestorePointInTime :
DefaultSecondaryLocation : West US 2
CatalogCollation :
CreateMode :
StorageContainerUri :
StorageContainerSasToken :
SourceDatabaseId :
FailoverGroupId :
此命令會取得以 「managedDatabase」 開頭之 managedInstance1 實例上的所有資料庫。
參數
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-InstanceName
實例名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-InstanceObject
要用於取得實例資料庫的實例物件
類型: | AzureSqlManagedInstanceModel |
別名: | ParentObject |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-InstanceResourceId
要取得的實例對象資源標識碼
類型: | String |
別名: | ParentResourceId |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Name
要擷取的 Azure SQL 實例資料庫名稱。
類型: | String |
別名: | InstanceDatabaseName |
Position: | 0 |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | True |
-ResourceGroupName
資源群組的名稱。
類型: | String |
Position: | 2 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |