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.
The Start-AzureSqlDatabaseCopy cmdlet starts a one-time copy operation or a continuous copy operation of a specific Azure SQL Database.
This cmdlet is not transactional.
The original database is the source database.
The copy is the secondary or target database.
For a continuous copy, the source and target databases cannot reside on the same server, and the servers that host the source and target databases must be part of the same subscription.
If you do not specify the ContinuousCopy parameter, this cmdlet creates a one-time copy of the source database.
When the response is received, the operation can still be in progress.
You can monitor the operation by using the Get-AzureSqlDatabaseCopy or Get-AzureSqlDatabaseOperation cmdlet.
If you specify ContinuousCopy, this cmdlet creates a continuous copy of the source database.
When the response is received, the operation will be in progress.
You can monitor the operation by using Get-AzureSqlDatabaseCopy or Get-AzureSqlDatabaseOperation.
You can create a continuous copy as an online or offline database.
The online continuous copy is used to configure Active Geo-Replication for Azure SQL Database/azure/azure-sql/database/active-geo-replication-overview.
The offline continuous copy is used to configure Standard Geo-Replication for Azure SQL Database/azure/azure-sql/database/business-continuity-high-availability-disaster-recover-hadr-overview.
This command schedules a continuous copy of the database named Orders on the server named lpqd0zbr8y.
The command creates a target database on the server named bk0b8kf658.
Example 2: Create a one-time copy on the same server
This command creates a one-time copy of the database named Orders on the server named lpqd0zbr8y.
The command creates a copy named OrdersCopy on the same server.
Example 3: Schedule a continuous offline database copy
This command schedules a continuous copy of the database named Orders on the server named lpqd0zbr8y.
This command creates an offline target database on the server named bk0b8kf658.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ContinuousCopy
Indicates that the database copy will be a continuous-copy (a replica database).
Continuous copy is not supported within the same server.
If this parameter is not specified, then a one-time copy is performed.
For a one-time copy, the source and partner databases must be on the same server.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByInputObjectContinuous
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ByDatabaseNameContinuous
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Database
Specifies an object that represents the source Azure SQL Database.
This parameter accepts pipeline input.
Parameter properties
Type:
Database
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByInputObject
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
ByInputObjectContinuous
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DatabaseName
Specifies the name of the source database.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByDatabaseName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ByDatabaseNameContinuous
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Force
Forces the command to run without asking for user confirmation.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OfflineSecondary
Specifies that a continuous copy is a passive copy rather than an active copy.
If the source database is a Standard edition database, then this parameter is required.
If this parameter is specified then ContinuousCopy must also be specified.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByInputObjectContinuous
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ByDatabaseNameContinuous
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PartnerDatabase
Specifies name of the target database.
If you specify the ContinuousCopy parameter, the value for PartnerDatabase must match the name of the source database.
If you do not specify ContinuousCopy, you must specify a name for the target database, which can be different from the source database name.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByInputObject
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ByDatabaseName
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PartnerServer
Specifies the name of the server that hosts the target database.
This server must be in the same Azure subscription as the source database server.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
ByInputObject
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
ByDatabaseName
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
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.
Parameter properties
Type:
AzureSMProfile
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ServerName
Specifies the name of the server on which the source database resides.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
True
Value from remaining arguments:
False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
Authentication: This cmdlet requires certificate-based authentication. For an example of how to use certificate-based authentication to set the current subscription, see New-AzureSqlDatabaseServerContext cmdlet.
Monitoring: To check for the status of one or more continuous copy relationships that are active on the server, use the Get-AzureSqlDatabaseCopy cmdlet. To verify the status of the operations at both the source and target of the continuous copy relationship, use the Get-AzureSqlDatabaseOperation cmdlet.