Get-AzSqlDatabase
Mendapatkan satu atau beberapa database.
Sintaks
Get-AzSqlDatabase
[[-DatabaseName] <String>]
[-ServerName] <String>
[-ResourceGroupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Deskripsi
Cmdlet Get-AzSqlDatabase mendapatkan satu atau beberapa database Azure SQL dari Server Database Azure SQL. Cmdlet ini juga didukung oleh layanan SQL Server Stretch Database di Azure.
Contoh
Contoh 1: Mendapatkan semua database di 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
Perintah ini mendapatkan semua database di server bernama server01.
Contoh 2: Mendapatkan database berdasarkan nama di 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
Perintah ini mendapatkan database bernama Database02 dari server bernama Server01.
Contoh 3: Mendapatkan semua database di server menggunakan pemfilteran
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
Perintah ini mendapatkan semua database di server bernama server01 yang dimulai dengan "database".
Parameter
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 yang akan diambil.
| Type: | String |
| Aliases: | Name |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | True |
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 nama grup sumber daya tempat server database ditetapkan.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Menentukan nama server tempat database ditetapkan.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True |
| 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 |
Input
Output
Link Terkait
Saran dan Komentar
Kirim dan lihat umpan balik untuk