Get-AzureRmSqlDatabase
Ottiene uno o più database.
Avviso
Il modulo AzureRM PowerShell è stato ufficialmente deprecato a partire dal 29 febbraio 2024. È consigliabile eseguire la migrazione da AzureRM al modulo Az PowerShell per garantire il supporto e gli aggiornamenti continui.
Anche se il modulo AzureRM può ancora funzionare, non è più gestito o supportato, posizionando qualsiasi uso continuo a discrezione e rischio dell'utente. Per indicazioni sulla transizione al modulo Az, vedere le risorse di migrazione.
Sintassi
Get-AzureRmSqlDatabase
[[-DatabaseName] <String>]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Descrizione
Il cmdlet Get-AzureRmSqlDatabase ottiene uno o più database SQL di Azure da un server di database SQL di Azure. Questo cmdlet è supportato anche dal servizio SQL Server Stretch Database in Azure.
Esempio
Esempio 1: Ottenere tutti i database in un server
PS C:\>Get-AzureRmSqlDatabase -ResourceGroupName "resourcegroup01" -ServerName "server01"
ResourceGroupName : resourcegroup01
ServerName : server01
DatabaseName : master
Location : Central US
DatabaseId : a2a7f2db-7526-4d86-a7b2-36276ee10dc6
Edition : None
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 5368709120
Status : Online
CreationDate : 7/3/2015 7:32:44 AM
CurrentServiceObjectiveId : c99ac918-dbea-463f-a475-16ec020fdc12
CurrentServiceObjectiveName : System1
RequestedServiceObjectiveId : c99ac918-dbea-463f-a475-16ec020fdc12
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
ResourceGroupName : resourcegroup01
ServerName : server01
DatabaseName : database01
Location : Central US
DatabaseId : a1e6bd1a-735a-4d48-8b98-afead5ef1218
Edition : Standard
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 7/3/2015 7:33:37 AM
CurrentServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
CurrentServiceObjectiveName : S0
RequestedServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
Questo comando ottiene tutti i database nel server denominato server01.
Esempio 2: Ottenere un database in base al nome in un server
PS C:\>Get-AzureRmSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02"
ResourceGroupName : resourcegroup01
ServerName : server01
DatabaseName : database01
Location : Central US
DatabaseId : a1e6bd1a-735a-4d48-8b98-afead5ef1218
Edition : Standard
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 7/3/2015 7:33:37 AM
CurrentServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
CurrentServiceObjectiveName : S0
RequestedServiceObjectiveId : f1173c43-91bd-4aaa-973c-54e79e15235b
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
Questo comando ottiene un database denominato Database02 da un server denominato Server01.
Parametri
-Confirm
Richiede conferma prima di eseguire il cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseName
Specifica il nome del database da recuperare.
Type: | String |
Aliases: | Name |
Position: | 2 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
Credenziali, account, tenant e sottoscrizione usati per la comunicazione con Azure
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceGroupName
Specifica il nome del gruppo di risorse a cui è assegnato il server di database.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServerName
Specifica il nome del server a cui è assegnato il database.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |