Set-AzureRmSqlDatabase
Imposta le proprietà per un database oppure sposta un database esistente in un pool elastico.
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
Set-AzureRmSqlDatabase
[-DatabaseName] <String>
[-MaxSizeBytes <Int64>]
[-Edition <String>]
[-RequestedServiceObjectiveName <String>]
[-ElasticPoolName <String>]
[-ReadScale <DatabaseReadScale>]
[-Tags <Hashtable>]
[-ZoneRedundant]
[-AsJob]
[-LicenseType <String>]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmSqlDatabase
[-DatabaseName] <String>
[-MaxSizeBytes <Int64>]
[-Edition <String>]
[-ReadScale <DatabaseReadScale>]
[-Tags <Hashtable>]
[-ZoneRedundant]
[-AsJob]
[-VCore <Int32>]
[-ComputeGeneration <String>]
[-LicenseType <String>]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmSqlDatabase
[-DatabaseName] <String>
-NewName <String>
[-AsJob]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Descrizione
Il cmdlet Set-AzureRmSqlDatabase imposta le proprietà per un database in database SQL di Azure. Questo cmdlet può modificare il livello di servizio (Edizione), il livello di prestazioni (RequestedServiceObjectiveName) e le dimensioni massime di archiviazione (MaxSizeBytes) per il database. È anche possibile specificare il parametro ElasticPoolName per spostare un database in un pool elastico. Se un database si trova già in un pool elastico, è possibile usare il parametro RequestedServiceObjectiveName per spostare il database da un pool elastico e in un livello di prestazioni per database singoli.
Esempio
Esempio 1: Aggiornare un database a un database S2 Standard
PS C:\>Set-AzureRmSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -Edition "Standard" -RequestedServiceObjectiveName "S2"
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 : 455330e1-00cd-488b-b5fa-177c226f28b7
CurrentServiceObjectiveName : S2
RequestedServiceObjectiveId : 455330e1-00cd-488b-b5fa-177c226f28b7
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
Questo comando aggiorna un database denominato Database01 a un database S2 Standard in un server denominato Server01.
Esempio 2: Aggiungere un database a un pool elastico
PS C:\>Set-AzureRmSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -ElasticPoolName "ElasticPool01"
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 : d1737d22-a8ea-4de7-9bd0-33395d2a7419
CurrentServiceObjectiveName : ElasticPool
RequestedServiceObjectiveId : d1737d22-a8ea-4de7-9bd0-33395d2a7419
RequestedServiceObjectiveName :
ElasticPoolName : elasticpool01
EarliestRestoreDate :
Tags :
Questo comando aggiunge un database denominato Database01 al pool elastico denominato ElasticPool01 ospitato nel server denominato Server01.
Esempio 3: Modificare le dimensioni massime di archiviazione di un database
PS C:\>Set-AzureRmSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -MaxSizeBytes 1099511627776
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 : 1099511627776
Status : Online
CreationDate : 8/24/2017 9:00:37 AM
CurrentServiceObjectiveId : 789681b8-ca10-4eb0-bdf2-e0b050601b40
CurrentServiceObjectiveName : S3
RequestedServiceObjectiveId : 789681b8-ca10-4eb0-bdf2-e0b050601b40
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
Questo comando aggiorna un database denominato Database01 per impostare le dimensioni massime su 1 TB.
Parametri
-AsJob
Eseguire il cmdlet in background
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ComputeGeneration
Generazione di calcolo da assegnare.
Type: | String |
Aliases: | Family |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-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.
Type: | String |
Aliases: | Name |
Position: | 2 |
Default value: | None |
Required: | True |
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 |
-Edition
Specifica l'edizione per il database. I valori validi per questo parametro sono:
- None
- Basic
- Standard
- Premium
- Datawarehouse
- Libero
- Estendi
- Utilizzo generico
- BusinessCritical
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ElasticPoolName
Specifica il nome del pool elastico in cui spostare il database.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LicenseType
Tipo di licenza per il database Sql di Azure.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaxSizeBytes
Dimensione massima del database SQL di Azure in byte.
Type: | Int64 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NewName
Nuovo nome in cui rinominare il database.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ReadScale
Opzione di scalabilità in lettura da assegnare al database SQL di Azure.( Abilitato/Disabilitato)
Type: | DatabaseReadScale |
Accepted values: | Disabled, Enabled |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RequestedServiceObjectiveName
Specifica il nome dell'obiettivo di servizio da assegnare al database. Per informazioni sugli obiettivi di servizio, vedere database SQL di Azure livelli di servizio e livelli di prestazioni nella libreria Microsoft Developer Network.
Type: | String |
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.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServerName
Specifica il nome del server che ospita il database.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Tags
Coppie chiave-valore sotto forma di tabella hash. Ad esempio: @{key0="value0"; key1=$null; key2="value2"}
Type: | Hashtable |
Aliases: | Tag |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VCore
Numero Vcore per il database Sql di Azure
Type: | Int32 |
Aliases: | Capacity |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
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 |
-ZoneRedundant
Ridondanza della zona da associare al database SQL di Azure
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |