SALES: 1-800-867-1380

Stop-AzureSqlDatabaseCopy

Stop-AzureSqlDatabaseCopy

Terminates a continuous copy relationship. There are two ways to end a continuous copy relationship; termination (planned termination), and forced termination (with possible data loss).

Syntax

Parameter Set: ByDatabase
Stop-AzureSqlDatabaseCopy [-ServerName] <String> [-Database] <Database> [-Force] [-ForcedTermination] [-PartnerDatabase <String> ] [-PartnerServer <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByDatabaseName
Stop-AzureSqlDatabaseCopy [-ServerName] <String> [-DatabaseName] <String> [-Force] [-ForcedTermination] [-PartnerDatabase <String> ] [-PartnerServer <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByInputObject
Stop-AzureSqlDatabaseCopy [-ServerName] <String> [-DatabaseCopy] <DatabaseCopy> [-Force] [-ForcedTermination] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

Terminates a continuous copy relationship by stopping the data movement between the source database and secondary (target) database, and changes the state of the secondary database to a standalone online database.

There are two ways to end a continuous copy relationship; termination (planned termination), and forced termination (with possible data loss). The Stop-AzureSqlDatabaseCopy command can be executed in termination or forced termination mode on the source server, but only forced termination mode is supported on the server hosting the secondary database.

A planned termination that is not forced waits until all committed transactions on the source database, at the time of the call, have been replicated to the secondary database. In contrast, forced termination does not wait for replication of any outstanding committed transactions and can result in possible data loss in the secondary database.

While replication status is PENDING only forced termination can successfully end a continuous copy relationship. Termination (not forced) is not supported when replication status is PENDING.

Parameters

-Database<Database>

A single object that represents the database whose continuous copy relationship is to be terminated.


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseCopy<DatabaseCopy>

An object representing the database whose continuous copy relationship is to be terminated. -DatabaseCopy can accept an array using the pipeline.


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-DatabaseName<String>

The name of the database whose continuous copy relationship is to be terminated.


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Allows the action to complete without prompting you for confirmation.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ForcedTermination

Causes forced termination of the continuous copy relationship (with possible data loss). You can abbreviate this parameter name to -Forced. On a target server, -ForcedTermination (or -Forced) is always required. On the source server, this parameter is required only if the secondary database is unavailable.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PartnerDatabase<String>

Specifies the name of a secondary database. If specified, this name must match the name of the source database.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PartnerServer<String>

The name of a target server.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServerName<String>

The name of the server on which the source database resides.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • Microsoft.WindowsAzure.Commands.SqlDatabase.Model.DatabaseCopy
  • Microsoft.WindowsAzure.Commands.SqlDatabase.Services.Server.Database

Outputs

The output type is the type of the objects that the cmdlet emits.

  • No output

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.

  • Restrictions:  On the server that hosts the secondary database, only forced termination is supported.

  • Impact of termination on the former secondary database:  After termination, the secondary database becomes an independent database. If seeding already completed on the secondary database, then after termination this database is open for full access. If the source database is a read-write database, the former secondary database becomes a read-write database, too.

    Note:  If seeding is currently in progress, seeding is aborted, and the former secondary database never becomes visible on the server that hosts the secondary database.

  • To guarantee that source and secondary databases are synchronized after termination, and to ensure that no transactions are committed during termination, set the source database to read-only mode before you perform a termination. Once the termination completes, set the source back to read-write mode. Optionally, you can also set the former secondary database to read-write mode.

  • Monitoring: To verify the status of the operations at both the source and target of the continuous copy relationship, use the Get-AzureSqlDatabaseOperation cmdlet.

Examples

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

This example terminates the continuous copy relationship of database "Orders" on the server "lpqd0zbr8y" with the secondary database on the "bk0b8kf658" target server.


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

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

This example forcibly terminates a continuous copy relationship from the server that hosts the secondary database.


PS C:\>$myDbCopy = Get-AzureSqlDatabaseCopy -ServerName "lpqd0zbr8y" -DatabaseName "Orders"
PS C:\>$myDbCopy | Stop-AzureSqlDatabaseCopy -ServerName "lpqd0zbr8y" -ForcedTermination

Related topics

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft