New-AzureRmSqlDatabaseSecondary
Syntax
New-AzureRmSqlDatabaseSecondary
[-ResourceGroupName] <String>
[-ServerName] <String>
[-DatabaseName] <String>
[-AllowConnections <AllowConnections>]
-PartnerResourceGroupName <String>
-PartnerServerName <String>
[-SecondaryElasticPoolName <String>]
[-SecondaryServiceObjectiveName <String>]
[-Tags <Hashtable>]
[-Confirm]
[-WhatIf]
[<CommonParameters>]
Description
The New-AzureRMSqlDatabaseSecondary cmdlet replaces the Start-AzureSqlDatabaseCopy cmdlet when used for setting up geo-replication for a database. It returns the geo-replication link object from the primary to the secondary database.
Examples
1: Establish Active Geo-Replication
$database = Get-AzureRmSqlDatabase -DatabaseName $databasename -ResourceGroupName $primaryresourcegroupname -ServerName $primaryservername
$database | New-AzureRmSqlDatabaseSecondary -PartnerResourceGroupName $secondaryresourcegroupname -PartnerServerName $secondaryservername -AllowConnections "All"
Required Parameters
Specifies the name of the database to act as primary.
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Specifies the name of the Azure Resource Group to which this cmdlet assigns the secondary database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the Azure SQL database server to act as secondary.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the Azure Resource Group to which this cmdlet assigns the primary database.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Specifies the name of the SQL Server of the primary SQL Database.
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Optional Parameters
Specifies the read intent of the secondary Azure SQL Database. The acceptable values for this parameter are:
- No
- All
| Type: | AllowConnections |
| Parameter Sets: | No, All |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the elastic pool in which to put the secondary database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the service objective to assign to the secondary database.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the Key-value pairs in the form of a hash table to associate with the SQL Database replication link. For example:
@{key0="value0";key1=$null;key2="value2"}
| Type: | Hashtable |
| Aliases: | Tag |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Outputs
Microsoft.Azure.Commands.Sql.Replication.Model.AzureReplicationLinkModel
This cmdlet returns ReplicationLink objects.