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

Get-AzureSqlDatabaseCopy

microsoft.windowsazure.commands.sqldatabase.dll

Synopsis

Checks the status of one or more copy relationships that are active on a specified server. This cmdlet is supported on both the source and target servers.

Syntax

Get-AzureSqlDatabaseCopy [-ServerName] [-DatabaseName] [-PartnerServer] [-PartnerDatabase] [<CommonParameters>]

Get-AzureSqlDatabaseCopy [-ServerName] [-DatabaseCopy] [<CommonParameters>]

Get-AzureSqlDatabaseCopy [-ServerName] [-Database] [-PartnerServer] [-PartnerDatabase] [<CommonParameters>]

Detailed Description

The Get-AzureSqlDatabaseCopy cmdlet checks for the status of one or more active copy relationships. You can check a specific copy relationship, all copy relationships, or a filtered list of copy relationships, such as all copies on a specific target server. This cmdlet is supported on a source or target server. Get-AzureSqlDatabaseCopy is synchronous and blocks the application until it returns a status object. -PartnerServer and -PartnerDatabase are optional. If either is omitted, Get-AzureSqlDatabaseCopy returns a table of results. If both parameters are specified, Get-AzureSqlDatabaseCopy returns the status on only the specified database on the specified target server.

Parameters

-ServerName <String>

The name of the SQL Database Server from which to retrieve the database copy.

Aliases

None

Required?

true

Position

0

Default value

None

Accept pipeline input?

true (ByValue, ByPropertyName)

Accept wildcard characters?

false

-DatabaseName <String>

The name of the source database.

Aliases

None

Required?

false

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PartnerServer <String>

The name of a target server. If a specified server is not found in the sys.dm_database_copies dynamic management view, an empty status object is returned.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-PartnerDatabase <String>

The name of a given replica database. If a specified database is not found in the sys.dm_database_copies dynamic management view, an empty status object is returned.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-DatabaseCopy <DatabaseCopy>

An object that represents the copy of the database whose copy status is to be returned. DatabaseCopy can accept an array that is passed using the PowerShell pipeline.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByValue)

Accept wildcard characters?

false

-Database <Database>

A single object that represents the database whose copy status is to be returned.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

true (ByValue)

Accept wildcard characters?

false

Input Type

Microsoft.WindowsAzure.Commands.SqlDatabase.Model.DatabaseCopy

Return Type

Microsoft.WindowsAzure.Commands.SqlDatabase.Model.DatabaseCopy

Notes

Authentication: This cmdlet requires certificate-based authentication. For an example of how to use certificate-based authentication to set the current subscription, see the Get-Help topic for the New-AzureSqlDatabaseServerContext cmdlet.

Examples

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

This example returns the status of the database, "Orders", on the server, "lpqd0zbr8y". The optional -PartnerServer parameter restricts this command to the "bk0b8kf658" target server.

PS C:\>Get-AzureSqlDatabaseCopy -ServerName "lpqd0zbr8y" -DatabaseName "Orders" -PartnerServer "bk0b8kf658"

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

This example starts a continuous copy relationship on the "Orders" database, and then gets the status of the copy.

PS C:\>$myDbCopy = Start-AzureSqlDatabaseCopy -ServerName "lpqd0zbr8y" -DatabaseName "Orders" -PartnerServer "bk0b8kf658" -ContinuousCopy
PS C:\>Get-AzureSqlDatabaseCopy -ServerName "lpqd0zbr8y" -DatabaseCopy $myDbCopy

Start-AzureSqlDatabaseCopy
Stop-AzureSqlDatabaseCopy