Condividi tramite


Get-AzSqlDatabase

Ottiene uno o più database.

Sintassi

Default (impostazione predefinita).

Get-AzSqlDatabase
    [[-DatabaseName] <String>]
    [-ExpandKeyList]
    [-KeysFilter <String>]
    [-ServerName] <String>
    [-ResourceGroupName] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Descrizione

Il cmdlet Get-AzSqlDatabase 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

Get-AzSqlDatabase -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							               :
CurrentBackupStorageRedundancy	 : Geo
RequestedBackupStorageRedundancy : Geo

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							               :
CurrentBackupStorageRedundancy	 : Geo
RequestedBackupStorageRedundancy : Geo

Questo comando ottiene tutti i database nel server denominato server01.

Esempio 2: Ottenere un database in base al nome in un server

Get-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02"
ResourceGroupName				         : resourcegroup01
ServerName						           : server01
DatabaseName					           : database02
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							               :
CurrentBackupStorageRedundancy	 : Geo
RequestedBackupStorageRedundancy : Geo

Questo comando ottiene un database denominato Database02 da un server denominato Server01.

Esempio 3: Ottenere tutti i database in un server usando filtri

Get-AzSqlDatabase -ResourceGroupName "resourcegroup01" -ServerName "server01" -DatabaseName "database*"
ResourceGroupName				         : resourcegroup01
ServerName						           : server01
DatabaseName					           : database01
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							               :
CurrentBackupStorageRedundancy	 : Geo
RequestedBackupStorageRedundancy : Geo

ResourceGroupName				         : resourcegroup01
ServerName						           : server01
DatabaseName					           : database02
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                             :
CurrentBackupStorageRedundancy	 : Geo
RequestedBackupStorageRedundancy : Geo

Questo comando ottiene tutti i database nel server denominato server01 che iniziano con "database".

Esempio 4: Ottenere un database con chiavi AKV TDE in un server usando il parametro delle chiavi di espansione.

Get-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02" -ExpandKeyList
ResourceGroupName				 : resourcegroup01
ServerName						 : server01
DatabaseName					 : database02
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							 :
CurrentBackupStorageRedundancy	 : Geo
RequestedBackupStorageRedundancy : Geo
Identity                         : Microsoft.Azure.Management.Sql.Models.DatabaseIdentity
EncryptionProtector              : https://contoso.vault.azure.net/keys/contosokey/01234567890123456789012345678901
Keys                             : {[https://contoso.vault.azure.net/keys/contosokey/01234567890123456789012345678901, Microsoft.Azure.Management.Sql.Models.DatabaseKey],
                                    [https://contoso.vault.azure.net/keys/contosokey2/09876543210987654321098765432109, Microsoft.Azure.Management.Sql.Models.DatabaseKey]}
FederatedClientId                :

Questo comando ottiene tutte le chiavi AKV TDE configurate nel database.

Esempio 5: Ottenere un database con chiavi AKV TDE in un server usando chiavi di espansione e filtrare in base alla data

Get-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02" -ExpandKeyList -KeysFilter "1/13/2022"
ResourceGroupName				 : resourcegroup01
ServerName						 : server01
DatabaseName					 : database02
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							 :
CurrentBackupStorageRedundancy	 : Geo
RequestedBackupStorageRedundancy : Geo
Identity                         : Microsoft.Azure.Management.Sql.Models.DatabaseIdentity
EncryptionProtector              : https://contoso.vault.azure.net/keys/contosokey/01234567890123456789012345678901
Keys                             : {[https://contoso.vault.azure.net/keys/contosokey/01234567890123456789012345678901, Microsoft.Azure.Management.Sql.Models.DatabaseKey],
                                    [https://contoso.vault.azure.net/keys/contosokey2/09876543210987654321098765432109, Microsoft.Azure.Management.Sql.Models.DatabaseKey]}
FederatedClientId                :

Questo comando ottiene un database configurato con chiavi CMK TDE

Esempio 6: Ottenere un database con chiavi AKV TDE in un server usando chiavi di espansione e filtrare come "corrente"

Get-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02" -ExpandKeyList -KeysFilter "current"
ResourceGroupName				 : resourcegroup01
ServerName						 : server01
DatabaseName					 : database02
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							 :
CurrentBackupStorageRedundancy	 : Geo
RequestedBackupStorageRedundancy : Geo
Identity                         : Microsoft.Azure.Management.Sql.Models.DatabaseIdentity
EncryptionProtector              : https://contoso.vault.azure.net/keys/contosokey/01234567890123456789012345678901
Keys                             :
FederatedClientId                :

Questo comando ottiene un database configurato con chiavi CMK TDE con filtro "corrente"

Esempio 7: Ottenere un database configurato con il tipo di enclave preferito come VBS

Get-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02"
ResourceGroupName             : ResourceGroup01
ServerName                    : Server01
DatabaseName                  : Database02
Location                      : Central US
DatabaseId                    : 34d9d561-42a7-484e-bf05-62ddef8000ab
Edition                       : GeneralPurpose
CollationName                 : SQL_Latin1_General_CP1_CI_AS
CatalogCollation              :
MaxSizeBytes                  : 268435456000
Status                        : Online
CreationDate                  : 8/26/2015 10:04:29 PM
CurrentServiceObjectiveName   : GP_Gen5_2
RequestedServiceObjectiveName :
ElasticPoolName               :
EarliestRestoreDate           :
LicenseType                   : LicenseIncluded
Tags                          :
EnableLedger                  : False
PreferredEnclaveType          : VBS

Questo comando ottiene un database configurato con l'enclave VBS

Parametri

-Confirm

Richiede conferma prima di eseguire il cmdlet.

Proprietà dei parametri

Tipo:SwitchParameter
Valore predefinito:False
Supporta i caratteri jolly:False
DontShow:False
Alias:cfr

Set di parametri

(All)
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-DatabaseName

Specifica il nome del database da recuperare.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:True
DontShow:False
Alias:Nome

Set di parametri

(All)
Posizione:2
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:True
Valore dagli argomenti rimanenti:False

-DefaultProfile

Credenziali, account, tenant e sottoscrizione usati per la comunicazione con Azure

Proprietà dei parametri

Tipo:IAzureContextContainer
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False
Alias:AzContext, AzureRmContext, AzureCredential

Set di parametri

(All)
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-ExpandKeyList

Flag da usare per visualizzare tutte le chiavi AKV in un database.

Proprietà dei parametri

Tipo:SwitchParameter
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

(All)
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

-KeysFilter

Filtro timestamp per ottenere chiavi AKV

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

(All)
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:True
Valore dagli argomenti rimanenti:False

-ResourceGroupName

Specifica il nome del gruppo di risorse a cui è assegnato il server di database.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

(All)
Posizione:0
Obbligatorio:True
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:True
Valore dagli argomenti rimanenti:False

-ServerName

Specifica il nome del server a cui è assegnato il database.

Proprietà dei parametri

Tipo:String
Valore predefinito:None
Supporta i caratteri jolly:False
DontShow:False

Set di parametri

(All)
Posizione:1
Obbligatorio:True
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:True
Valore dagli argomenti rimanenti:False

-WhatIf

Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.

Proprietà dei parametri

Tipo:SwitchParameter
Valore predefinito:False
Supporta i caratteri jolly:False
DontShow:False
Alias:Wi

Set di parametri

(All)
Posizione:Named
Obbligatorio:False
Valore dalla pipeline:False
Valore dalla pipeline in base al nome della proprietà:False
Valore dagli argomenti rimanenti:False

CommonParameters

Questo cmdlet supporta i parametri comuni: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction e -WarningVariable. Per altre informazioni, vedi about_CommonParameters.

Input

String

Output

AzureSqlDatabaseModel