Get-AzSqlInstanceDatabase
Returnerar information om Azure SQL Managed Instance-databasen.
Syntax
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
Cmdleten Get-AzSqlInstanceDatabase hämtar en eller flera Azure SQL-databaser från en Azure SQL Managed Instance.
Exempel
Exempel 1: Hämta alla databaser på en instans
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 :
Det här kommandot hämtar alla databaser på instansen med namnet managedInstance1.
Exempel 2: Hämta en databas efter namn på en hanterad instans
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 :
Det här kommandot hämtar en databas med namnet managedDatabase1 från en instans med namnet managedInstance1.
Exempel 3: Hämta alla databaser på en instans med filtrering
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 :
Det här kommandot hämtar alla databaser på instansen med namnet managedInstance1 som börjar med "managedDatabase".
Parametrar
-DefaultProfile
Autentiseringsuppgifter, konto, klientorganisation och prenumeration som används för kommunikation med Azure.
Typ: | IAzureContextContainer |
Alias: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-InstanceName
Instansnamnet.
Typ: | String |
Position: | 1 |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-InstanceObject
Det instansobjekt som ska användas för att hämta instansdatabasen
Typ: | AzureSqlManagedInstanceModel |
Alias: | ParentObject |
Position: | 0 |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | True |
Godkänn jokertecken: | False |
-InstanceResourceId
Resurs-ID för instansobjektet som ska hämtas
Typ: | String |
Alias: | ParentResourceId |
Position: | 0 |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | True |
Godkänn jokertecken: | False |
-Name
Namnet på den Azure SQL Instance Database som ska hämtas.
Typ: | String |
Alias: | InstanceDatabaseName |
Position: | 0 |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | True |
-ResourceGroupName
Namnet på resursgruppen.
Typ: | String |
Position: | 2 |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
Indata
Utdata
Azure PowerShell