Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureSqlRecoverableDatabase

Get-AzureSqlRecoverableDatabase

microsoft.windowsazure.commands.sqldatabase.dll

Synopsis

Gets a list of databases that can be recovered.

Syntax

Get-AzureSqlRecoverableDatabase [-ServerName] [<CommonParameters>]

Get-AzureSqlRecoverableDatabase [-ServerName] [-DatabaseName] [<CommonParameters>]

Get-AzureSqlRecoverableDatabase [-Database] [<CommonParameters>]

Detailed Description

This cmdlet can be used to get a list of databases that can be recovered when the database server is no longer available. The database can be recovered to the same server as the source database or to a different server.

Parameters

-ServerName <String>

The name of the server where the database is live and running, or the name of the server where the database was running before it was deleted.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DatabaseName <String>

The name of the database you want to recover.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Database <RecoverableDatabase>

The database object representing the database you want to retrieve

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

true (ByValue)

Accept wildcard characters?

false

Input Type

Microsoft.WindowsAzure.Management.Sql.Models.RecoverableDatabase

Return Type

Microsoft.WindowsAzure.Management.Sql.Models.RecoverableDatabase

Notes

You must use certificate based authentication to run this cmdlet. The following commands need to be run to on the machine you are using to run the command from: C:\PS>$subId = <Subscription ID> C:\PS>$thumbprint = <Certificate Thumbprint> C:\PS>$myCert = Get-Item Cert:\CurrentUser\My\$thumbprint C:\PS>Set-AzureSubscription -SubscriptionName "mySubscription" -SubscriptionId $subId -Certificate $myCert C:\PS>Select-AzureSubscription -SubscriptionName "mySubscription"

Examples

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

This example lists all the recoverable databases on the source server.

PS C:\>Get-AzureSqlRecoverableDatabase -ServerName "server1"

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

This example retrieves a specific database on source server.

PS C:\>$mydb = Get-AzureSqlRecoverableDatabase -ServerName "server1" -DatabaseName "mydb"
# refresh 
PS C:\>$mydb = $mydb | Get-AzureSqlRecoverableDatabase

Start-AzureSqlDatabaseRecovery