你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
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>]
说明
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
要获取的实例对象的资源 ID
类型: | 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 |