New-AzSqlDatabase
Buat database atau database elastis.
Sintaks
New-AzSqlDatabase
-DatabaseName <String>
[-CollationName <String>]
[-CatalogCollation <String>]
[-MaxSizeBytes <Int64>]
[-Edition <String>]
[-RequestedServiceObjectiveName <String>]
[-ElasticPoolName <String>]
[-ReadScale <DatabaseReadScale>]
[-Tags <Hashtable>]
[-SampleName <String>]
[-ZoneRedundant]
[-AsJob]
[-Force]
[-LicenseType <String>]
[-AutoPauseDelayInMinutes <Int32>]
[-MinimumCapacity <Double>]
[-HighAvailabilityReplicaCount <Int32>]
[-BackupStorageRedundancy <String>]
[-SecondaryType <String>]
[-MaintenanceConfigurationId <String>]
[-EnableLedger]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzSqlDatabase
-DatabaseName <String>
[-CollationName <String>]
[-CatalogCollation <String>]
[-MaxSizeBytes <Int64>]
-Edition <String>
[-ReadScale <DatabaseReadScale>]
[-Tags <Hashtable>]
[-SampleName <String>]
[-ZoneRedundant]
[-AsJob]
[-Force]
-VCore <Int32>
-ComputeGeneration <String>
[-LicenseType <String>]
[-ComputeModel <String>]
[-AutoPauseDelayInMinutes <Int32>]
[-MinimumCapacity <Double>]
[-HighAvailabilityReplicaCount <Int32>]
[-BackupStorageRedundancy <String>]
[-SecondaryType <String>]
[-MaintenanceConfigurationId <String>]
[-EnableLedger]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Deskripsi
Cmdlet New-AzSqlDatabase membuat database Azure SQL. Anda juga dapat membuat database elastis dengan mengatur parameter ElasticPoolName ke kumpulan elastis yang ada.
Contoh
Contoh 1: Membuat database di server tertentu
New-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01"
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 :
LicenseType :
Tags :
EnableLedger : False
Perintah ini membuat database bernama Database01 di server Server01.
Contoh 2: Membuat database elastis di server tertentu
New-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database02" -ElasticPoolName "ElasticPool01"
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database02
Location : Central US
DatabaseId : 7bd9d561-42a7-484e-bf05-62ddef8015ab
Edition : Standard
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 268435456000
Status : Online
CreationDate : 8/26/2015 10:04:29 PM
CurrentServiceObjectiveId : d1737d22-a8ea-4de7-9bd0-33395d2a7419
CurrentServiceObjectiveName : ElasticPool
RequestedServiceObjectiveId : d1737d22-a8ea-4de7-9bd0-33395d2a7419
RequestedServiceObjectiveName :
ElasticPoolName : ElasticPool01
EarliestRestoreDate :
LicenseType :
Tags :
EnableLedger : False
Perintah ini membuat database bernama Database02 di kumpulan elastis bernama ElasticPool01 di server Server01.
Contoh 3: Membuat database Vcore di server tertentu
New-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database03" -Edition "GeneralPurpose" -Vcore 2 -ComputeGeneration "Gen4"
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database03
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_Gen4_2
RequestedServiceObjectiveName :
ElasticPoolName :
EarliestRestoreDate :
LicenseType : LicenseIncluded
Tags :
EnableLedger : False
Perintah ini membuat database Vcore bernama Database03 di server Server01.
Contoh 4: Membuat database Tanpa Server di server yang ditentukan
New-AzSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database04" -Edition "GeneralPurpose" -Vcore 2 -ComputeGeneration "Gen5" -ComputeModel Serverless
ResourceGroupName : ResourceGroup01
ServerName : Server01
DatabaseName : Database04
Location : Central US
DatabaseId : ef5a9698-012c-4def-8d94-7f6bfb7b4f04
Edition : GeneralPurpose
CollationName : SQL_Latin1_General_CP1_CI_AS
CatalogCollation :
MaxSizeBytes : 34359738368
Status : Online
CreationDate : 4/12/2019 11:20:29 PM
CurrentServiceObjectiveName : GP_S_Gen5_2
RequestedServiceObjectiveName : GP_S_Gen5_2
ElasticPoolName :
EarliestRestoreDate : 4/12/2019 11:50:29 PM
Tags :
CreateMode :
ReadScale : Disabled
ZoneRedundant : False
Capacity : 2
Family : Gen5
SkuName : GP_S_Gen5
LicenseType : LicenseIncluded
AutoPauseDelayInMinutes : 360
EnableLedger : False
MinimumCapacity : 0.5
Perintah ini membuat database Tanpa Server bernama Database04 di server Server01.
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 |
Menentukan nama kolase katalog database SQL.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan nama kolase database SQL.
| Type: | String |
| 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 untuk 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: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| 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 ditetapkan ke database. Nilai yang dapat diterima untuk parameter ini adalah:
- Tidak ada
- Dasar
- Standar
- Premium
- Gudang Data
- Gratis
- Stretch
- GeneralPurpose
- BusinessCritical
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan nama kumpulan elastis untuk menempatkan database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Membuat database ledger, di mana integritas semua data dilindungi oleh fitur ledger. Semua tabel dalam database ledger harus berupa tabel ledger. Catatan: nilai properti ini tidak dapat diubah setelah database dibuat.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Lewati pesan konfirmasi untuk melakukan tindakan
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Jumlah replika sekunder baca-saja yang terkait dengan database tempat koneksi niat aplikasi readonly dapat dirutekan. Properti ini hanya dapat diatur untuk database 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 |
Menentukan ukuran maksimum database 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 |
Jika diaktifkan, koneksi yang memiliki niat aplikasi yang diatur ke baca-saja dalam string koneksinya dapat dirutekan ke replika sekunder baca-saja. Properti ini hanya dapat diatur untuk database Premium dan Business Critical.
| 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.
| 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 |
Nama skema sampel yang akan diterapkan saat membuat database ini.
| Type: | String |
| Accepted values: | AdventureWorksLT |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| 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 |
Menentukan kamus pasangan Kunci-nilai dalam bentuk tabel hash yang dikaitkan cmdlet ini dengan database baru. 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