< Back

New-AzureRmSqlDatabaseSecondary

Tue Jan 29, 2019 10:09 pm

NAME New-AzureRmSqlDatabaseSecondary



SYNOPSIS

Creates a secondary database for an existing database and starts data replication.





SYNTAX

New-AzureRmSqlDatabaseSecondary [-ResourceGroupName] <String> [-ServerName] <String> [-DatabaseName] <String> [-AllowConnections {No | All}]

[-AsJob] [-DefaultProfile <IAzureContextContainer>] -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.





PARAMETERS

-AllowConnections <AllowConnections>

Specifies the read intent of the secondary Azure SQL Database. The acceptable values for this parameter are:



- No



- All



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AsJob [<SwitchParameter>]

Run cmdlet in the background



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-DatabaseName <String>

Specifies the name of the database to act as primary.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PartnerResourceGroupName <String>

Specifies the name of the Azure Resource Group to which this cmdlet assigns the secondary database.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PartnerServerName <String>

Specifies the name of the Azure SQL database server to act as secondary.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the Azure Resource Group to which this cmdlet assigns the primary database.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SecondaryElasticPoolName <String>

Specifies the name of the elastic pool in which to put the secondary database.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SecondaryServiceObjectiveName <String>

Specifies the name of the service objective to assign to the secondary database.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ServerName <String>

Specifies the name of the SQL Server of the primary SQL Database.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Tags <Hashtable>

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"}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Sql.Replication.Model.AzureReplicationLinkModel

This cmdlet returns ReplicationLink objects.





NOTES









1: Establish Active Geo-Replication



$database = Get-AzureRmSqlDatabase -DatabaseName $databasename -ResourceGroupName $primaryresourcegroupname -ServerName $primaryservername

$database | New-AzureRmSqlDatabaseSecondary -PartnerResourceGroupName $secondaryresourcegroupname -PartnerServerName $secondaryservername

-AllowConnections "All"











RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... esecondary

Remove-AzureRmSqlDatabaseSecondary

Set-AzureRmSqlDatabaseSecondary

SQL Database Documentation https://docs.microsoft.com/azure/sql-database/