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
 

Start-AzureSqlDatabaseRecovery

Start-AzureSqlDatabaseRecovery

microsoft.windowsazure.commands.sqldatabase.dll

Synopsis

Submits a recover database request for a live or dropped database.

Syntax

Start-AzureSqlDatabaseRecovery [-SourceServerName] [-SourceDatabaseName] [-TargetServerName] [-TargetDatabaseName] [<CommonParameters>]

Start-AzureSqlDatabaseRecovery [-SourceDatabase] [-TargetServerName] [-TargetDatabaseName] [<CommonParameters>]

Detailed Description

This cmdlet is used to submit a restore request for a live or dropped database. This cmdlet supports basic recovery using the last known available backup for the database. The recovery operation creates a new database. You must specify a different name for the new database if you are recovering a live database on the same server. If you want to do a point in time restore for a database, use Start-AzureSqlDatabaseRestore cmdlet instead.

Parameters

-SourceServerName <String>

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

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-SourceDatabaseName <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

-TargetServerName <String>

The name of the server you want to restore the database to. This can be the same server as the source database or a different server name.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-TargetDatabaseName <String>

The name of the recovered database. This should be different from the source database if the source database is still live and you are planning to recover it to the same server as the source.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-SourceDatabase <RecoverableDatabase>

The database object that represents the database you want to recover.

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.RecoverDatabaseOperation

Notes

You must use certificate based authentication to run this cmdlet. The following commands need to be run on the machine you are using to run the cmdlet: 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 recovers a database using an object representing the database.

PS C:\>$mydb = Get-AzureSqlRecoverableDatabase -ServerName "myserver" -DatabaseName "mydatabase"
# Recover the database using database object 
PS C:\>$operation = Start-AzureSqlDatabaseRecovery -SourceDatabase $mydb -TargetServerName "a234b56" -TargetDatabaseName "mydatabaserestored"

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

This example recovers a database using the database name.

PS C:\>$operation = Start-AzureSqlDatabaseRecovery -SourceServerName "myserver" -SourceDatabaseName "mydatabase" -TargetServerName "a234b56" -TargetDatabaseName "mydatabaserestored"

Start-AzureSqlDatabaseRestore
Get-AzureSqlRecoverableDatabase