Get-​Azure​Sql​Database​Copy

Checks the status of copy relationships.

Syntax

Get-AzureSqlDatabaseCopy
   -Database <Database>
   [-PartnerDatabase <String>]
   [-PartnerServer <String>]
   [-Profile <AzureSMProfile>]
   -ServerName <String>
   [<CommonParameters>]
Get-AzureSqlDatabaseCopy
   -DatabaseCopy <DatabaseCopy>
   [-Profile <AzureSMProfile>]
   -ServerName <String>
   [<CommonParameters>]
Get-AzureSqlDatabaseCopy
   [-DatabaseName <String>]
   [-PartnerDatabase <String>]
   [-PartnerServer <String>]
   [-Profile <AzureSMProfile>]
   -ServerName <String>
   [<CommonParameters>]

Description

The Get-AzureSqlDatabaseCopy cmdlet checks the status of one or more active copy relationships. Run this cmdlet after you run the Start-AzureSqlDatabaseCopy or Stop-AzureSqlDatabaseCopy cmdlet. 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. You can run this cmdlet on the server that hosts the source or target database.

This cmdlet is synchronous. The cmdlet blocks the Azure PowerShell console until it returns a status object.

The PartnerServer and PartnerDatabase parameters are optional. If you do not specify either parameter, this cmdlet returns a table of results. To see the status for only a particular database, specify both parameters.

Examples

Example 1: Get the copy status of a database

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

This command gets the status of the database named Orders on the server named lpqd0zbr8y. The PartnerServer parameter restricts this command to the bk0b8kf658 server.

Example 2: Get the status of all copies on a serverGet the status of all copies on a server

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

This command gets the status of all active copies on the server named lpqd0zbr8y.

Required Parameters

-Database

Specifies an object that represents the source Azure SQL Database. This cmdlet gets the copy status of the database that this parameter specifies.

Type:Database
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-DatabaseCopy

Specifies an object that represents a database. This cmdlet gets the copy status of the database that this parameter specifies. This parameter accepts pipeline input.

Type:DatabaseCopy
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-ServerName

Specifies the name of the server on which the database copy resides.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-DatabaseName

Specifies the name of the source database. This cmdlet gets that copy status of the database that this parameter specifies.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartnerDatabase

Specifies name of the secondary database. If this database is not found in the sys.dm_database_copies dynamic management view, this cmdlet returns an empty status object.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartnerServer

Specifies the name of the server that hosts the target database. If this server is not found in the sys.dm_database_copies dynamic management view, this cmdlet returns an empty status object.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Model.DatabaseCopy

Inputs

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

Outputs

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 New-AzureSqlDatabaseServerContext cmdlet.