VENDAS: 1-800-867-1389
EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

Get-AzureSqlDatabase

Get-AzureSqlDatabase

Returns an Azure SQL Database from the specified SQL Database Server.

Syntax

Parameter Set: ByConnectionContext
Get-AzureSqlDatabase [-ConnectionContext] <IServerDataServiceContext> [-Database <Database> ] [-DatabaseDeletionDate <DateTime> ] [-DatabaseName <String> ] [-RestorableDropped] [-RestorableDroppedDatabase <RestorableDroppedDatabase> ] [ <CommonParameters>]

Parameter Set: ByServerName
Get-AzureSqlDatabase [-ServerName] <String> [-Database <Database> ] [-DatabaseDeletionDate <DateTime> ] [-DatabaseName <String> ] [-RestorableDropped] [-RestorableDroppedDatabase <RestorableDroppedDatabase> ] [ <CommonParameters>]




Detailed Description

Use the Get-AzureSqlDatabase cmdlet to retrieve a SQL Database from a SQL Database Server. You can specify the server with a SQL Database Server connection context that you create using the New-AzureSqlDatabaseServerContext cmdlet. Or, if you specify the SQL Database Server name, the cmdlet uses the current Azure subscription information to authenticate the request to access the server.

You also can retrieve a restorable dropped database by specifying the RestorableDropped parameter. You can select the database to return by specifying the name and deletion date with the DatabaseDeletionDate parameter. If you specify the RestorableDropped parameter and do not specify a database name and deletion date, then all restorable dropped databases on the specified server are returned.

If the database is not specified, the Get-AzureSqlDatabase cmdlet returns all SQL Databases from the specified SQL Database Server.

Parameters

-ConnectionContext<IServerDataServiceContext>

The connection context to a SQL Database Server from which to retrieve a SQL database.


Aliases

Context

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Database<Database>

A database object representing the SQL Database to be retrieved.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseDeletionDate<DateTime>

If the RestorableDropped parameter is specified, then you can use this parameter to retrieve a restorable dropped database based on the deletion date.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DatabaseName<String>

The name of the SQL Database to be retrieved.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RestorableDropped

If specified, the Get-AzureSqlDatabase cmdlet returns RestorableDroppedDatabase objects instead of Database objects, and the DatabaseDeletionDate parameter may be used to select a specific restorable dropped database.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RestorableDroppedDatabase<RestorableDroppedDatabase>

The object representing the restorable dropped database to retrieve.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-ServerName<String>

The name of the SQL Database Server containing the database to be retrieved. The cmdlet uses the current Azure subscription to access the server.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database
  • Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server. RestorableDroppedDatabase

Outputs

The output type is the type of the objects that the cmdlet emits.

  • IEnumerable<Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database>

    Returns a Database object if the RestoreableDropped parameter is not specified.


  • IEnumerable<Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.RestorableDroppedDatabase>

    Returns a RestorableDroppedDatabase object if the RestoreableDropped parameter is specified.


Examples

-------------------------- EXAMPLE 1 --------------------------

This example returns all the databases on the SQL Database Server, "lpqd0zbr8y".


C:\PS>Get-AzureSqlDatabase -ServerName "lpqd0zbr8y"

-------------------------- EXAMPLE 2 --------------------------

This example returns all the restorable dropped databases on the SQL Database Server, "lpqd0zbr8y".


C:\PS>Get-AzureSqlDatabase -ServerName "lpqd0zbr8y" -RestorableDropped

-------------------------- EXAMPLE 3 --------------------------

This example returns the database, "Database1", from the SQL Database Server specified by the connection context “$ctx”.


C:\PS>$database1 = Get-AzureSqlDatabase -ConnectionContext $ctx -DatabaseName "Database1"

-------------------------- EXAMPLE 4 --------------------------

This example returns the database, "Database1", from the SQL Database Server, "lpqd0zbr8y".


C:\PS>$database1 = Get-AzureSqlDatabase -ServerName "lpqd0zbr8y" -DatabaseName "Database1"

-------------------------- EXAMPLE 5 --------------------------

This example returns the restorable dropped database, "Database1", that was deleted on 11/9/2012 from SQL Database Server, "lpqd0zbr8y".


C:\PS>$droppedDB = Get-AzureSqlDatabase -ServerName "lpqd0zbr8y" -DatabaseName "Database1" -DatabaseDeletionDate "2012-11-09T22:59:43.000Z" -RestorableDropped

Related topics

Isso foi útil para você?
(1500 caracteres restantes)
Agradecemos os seus comentários
Mostrar:
© 2014 Microsoft