Set-AzSqlDatabase
Mengatur properti untuk database, atau memindahkan database yang ada ke dalam kumpulan elastis.
Sintaks
Set-AzSqlDatabase
[-DatabaseName] <String>
[-MaxSizeBytes <Int64>]
[-Edition <String>]
[-RequestedServiceObjectiveName <String>]
[-ElasticPoolName <String>]
[-ReadScale <DatabaseReadScale>]
[-Tags <Hashtable>]
[-ZoneRedundant]
[-AsJob]
[-LicenseType <String>]
[-ComputeModel <String>]
[-AutoPauseDelayInMinutes <Int32>]
[-MinimumCapacity <Double>]
[-HighAvailabilityReplicaCount <Int32>]
[-BackupStorageRedundancy <String>]
[-SecondaryType <String>]
[-MaintenanceConfigurationId <String>]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzSqlDatabase
[-DatabaseName] <String>
[-MaxSizeBytes <Int64>]
[-Edition <String>]
[-ReadScale <DatabaseReadScale>]
[-Tags <Hashtable>]
[-ZoneRedundant]
[-AsJob]
[-VCore <Int32>]
[-ComputeGeneration <String>]
[-LicenseType <String>]
[-ComputeModel <String>]
[-AutoPauseDelayInMinutes <Int32>]
[-MinimumCapacity <Double>]
[-HighAvailabilityReplicaCount <Int32>]
[-BackupStorageRedundancy <String>]
[-SecondaryType <String>]
[-MaintenanceConfigurationId <String>]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzSqlDatabase
[-DatabaseName] <String>
-NewName <String>
[-AsJob]
[-BackupStorageRedundancy <String>]
[-SecondaryType <String>]
[-MaintenanceConfigurationId <String>]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Deskripsi
Cmdlet Set-AzSqlDatabase mengatur properti untuk database di Azure SQL Database. Cmdlet ini dapat memodifikasi tingkat layanan (Edisi), tingkat performa (RequestedServiceObjectiveName), dan ukuran maksimum penyimpanan (MaxSizeBytes) untuk database. Selain itu, Anda dapat menentukan parameter ElasticPoolName untuk memindahkan database ke kumpulan elastis. Jika database sudah berada dalam kumpulan elastis, Anda dapat menggunakan parameter RequestedServiceObjectiveName untuk memindahkan database keluar dari kumpulan elastis dan ke tingkat performa untuk database tunggal.
Contoh
Contoh 1: Memperbarui database ke database S0 Standar
Set-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -Edition "Standard" -RequestedServiceObjectiveName "S0"
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 : S0
RequestedServiceObjectiveId : 455330e1-00cd-488b-b5fa-177c226f28b7
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
Tags :
Perintah ini memperbarui database bernama Database01 ke database S0 Standar di server bernama Server01.
Contoh 2: Menambahkan database ke kumpulan elastis
Set-AzSqlDatabase -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 :
Perintah ini menambahkan database bernama Database01 ke kumpulan elastis bernama ElasticPool01 yang dihosting di server bernama Server01.
Contoh 3: Mengubah ukuran maksimum penyimpanan database
Set-AzSqlDatabase -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 :
Perintah ini memperbarui database bernama Database01 untuk mengatur ukuran maksimumnya menjadi 1 TB.
Contoh 4: Memperbarui database Tujuan Umum yang ada ke tingkat layanan Hyperscale
Set-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -DatabaseName "Database01" -ServerName "Server01" -Edition "Hyperscale" -RequestedServiceObjectiveName "HS_Gen5_2"
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database01
Location : Central US
DatabaseId : 56246136-839f-4171-80af-4c28142463b1
Edition : Hyperscale
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : -1
Status : Online
CreationDate : 12/6/2020 5:34:16 PM
CurrentServiceObjectiveId : 00000000-0000-0000-0000-000000000000
CurrentServiceObjectiveName : HS_Gen5_2
RequestedServiceObjectiveName : HS_Gen5_2
RequestedServiceObjectiveId :
ElasticPoolName :
EarliestRestoreDate : 12/6/2020 5:34:16 PM
Tags : {}
ResourceId : /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/servers/Server01/databases/Database01
CreateMode :
ReadScale : Enabled
ZoneRedundant :
Capacity : 2
Family : Gen5
SkuName : HS_Gen5
LicenseType : LicenseIncluded
AutoPauseDelayInMinutes :
MinimumCapacity :
ReadReplicaCount : 1
BackupStorageRedundancy : Geo
Perintah ini memperbarui database bernama Database01 dari Tujuan Umum ke tingkat layanan Hyperscale.
Parameter
Jalankan cmdlet di latar belakang
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Penundaan jeda otomatis dalam menit untuk database (hanya tanpa server), -1 untuk menolak
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Redundansi penyimpanan Cadangan yang digunakan untuk menyimpan cadangan untuk SQL Database. Opsinya adalah: Lokal, Zona, dan Geo.
| Type: | String |
| Accepted values: | Local, Zone, Geo, GeoZone |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Pembuatan komputasi yang akan ditetapkan.
| Type: | String |
| Aliases: | Family |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Model komputasi database Azure Sql. Tanpa server atau Disediakan
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Meminta Anda mengonfirmasi sebelum menjalankan cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan nama database.
| Type: | String |
| Aliases: | Name |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan azure
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan edisi untuk database. Nilai yang dapat diterima untuk parameter ini adalah:
- Tidak ada
- Dasar
- Standar
- Premium
- Gudang Data
- Gratis
- Stretch
- GeneralPurpose
- Hiperscale
- BusinessCritical
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan nama kumpulan elastis untuk memindahkan database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Jumlah replika sekunder baca-saja yang terkait dengan database. Hanya untuk edisi Hyperscale.
| Type: | Int32 |
| Aliases: | ReadReplicaCount |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Jenis lisensi untuk database Azure Sql. Potensi nilai:
- Harga diskon BasePrice - Azure Hybrid Benefit (AHB) untuk pemilik lisensi SQL Server yang ada diterapkan. Harga database akan didiskon untuk pemilik lisensi SQL Server yang ada.
- LicenseIncluded - Harga diskon Azure Hybrid Benefit (AHB) untuk pemilik lisensi SQL Server yang ada tidak diterapkan. Harga database akan mencakup biaya lisensi SQL Server baru.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Id konfigurasi Pemeliharaan untuk SQL Database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Ukuran maksimum database Azure SQL dalam byte.
| Type: | Int64 |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Kapasitas Minimal yang akan selalu dialokasikan database, jika tidak dijeda. Hanya untuk database Azure Sql tanpa server.
| Type: | Double |
| Aliases: | MinVCore, MinCapacity |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Nama baru untuk mengganti nama database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Jika diaktifkan, koneksi yang memiliki niat aplikasi diatur ke readonly dalam string koneksinya dapat dirutekan ke replika sekunder baca-saja. Properti ini hanya dapat diatur untuk database Premium dan Bisnis Penting.
| Type: | DatabaseReadScale |
| Accepted values: | Disabled, Enabled |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan nama tujuan layanan untuk ditetapkan ke database. Untuk informasi tentang tujuan layanan, lihat Azure SQL Tingkat Layanan Database dan Tingkat Performa di Pustaka Jaringan Pengembang Microsoft.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan nama grup sumber daya tempat server ditetapkan.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Jenis sekunder database jika merupakan sekunder. Nilai yang valid adalah Geo dan Named.
| Type: | String |
| Accepted values: | Named, Geo |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan nama server yang menghosting database.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Pasangan kunci-nilai dalam bentuk tabel hash. Misalnya: @{key0="value0";key1=$null;key2="value2"}
| Type: | Hashtable |
| Aliases: | Tag |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Nomor Vcore untuk database Azure Sql
| Type: | Int32 |
| Aliases: | Capacity, MaxVCore, MaxCapacity |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menunjukkan apa yang akan terjadi jika cmdlet berjalan. Cmdlet tidak dijalankan.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Redundansi zona untuk dikaitkan dengan Azure Sql Database
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Input
Output
Link Terkait
Saran dan Komentar
Kirim dan lihat umpan balik untuk