Get-AzureSqlDatabaseCopy

Checks the status of copy relationships.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Get-AzureSqlDatabaseCopy
   -ServerName <String>
   [-DatabaseName <String>]
   [-PartnerServer <String>]
   [-PartnerDatabase <String>]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSqlDatabaseCopy
   -ServerName <String>
   -DatabaseCopy <DatabaseCopy>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]
Get-AzureSqlDatabaseCopy
   -ServerName <String>
   -Database <Database>
   [-PartnerServer <String>]
   [-PartnerDatabase <String>]
   [-Profile <AzureSMProfile>]
   [<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.

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
Required:True
Accept pipeline input:True
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
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-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
Required:False
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
Required:False
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
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ServerName

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

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

Microsoft.WindowsAzure.Commands.SqlDatabase.Model.DatabaseCopy

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.