Skip to main content

replication_links

Creates, updates, deletes, gets or lists a replication_links resource.

Overview

Namereplication_links
TypeResource
Idazure.sql.replication_links

Fields

NameDatatypeDescription
databaseNametextfield from the properties object
is_termination_allowedtextfield from the properties object
linkIdtextfield from the properties object
link_typetextfield from the properties object
partner_databasetextfield from the properties object
partner_database_idtextfield from the properties object
partner_locationtextfield from the properties object
partner_roletextfield from the properties object
partner_servertextfield from the properties object
percent_completetextfield from the properties object
replication_modetextfield from the properties object
replication_statetextfield from the properties object
resourceGroupNametextfield from the properties object
roletextfield from the properties object
serverNametextfield from the properties object
start_timetextfield from the properties object
subscriptionIdtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, linkId, resourceGroupName, serverName, subscriptionIdGets a replication link.
list_by_databaseSELECTdatabaseName, resourceGroupName, serverName, subscriptionIdGets a list of replication links on database.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdGets a list of replication links.
create_or_updateINSERTdatabaseName, linkId, resourceGroupName, serverName, subscriptionIdUpdates the replication link type.
deleteDELETEdatabaseName, linkId, resourceGroupName, serverName, subscriptionIdDeletes the replication link.
updateUPDATEdatabaseName, linkId, resourceGroupName, serverName, subscriptionIdUpdates the replication link type.
failoverEXECdatabaseName, linkId, resourceGroupName, serverName, subscriptionIdFails over from the current primary server to this server.
failover_allow_data_lossEXECdatabaseName, linkId, resourceGroupName, serverName, subscriptionIdFails over from the current primary server to this server allowing data loss.

SELECT examples

Gets a list of replication links.

SELECT
databaseName,
is_termination_allowed,
linkId,
link_type,
partner_database,
partner_database_id,
partner_location,
partner_role,
partner_server,
percent_complete,
replication_mode,
replication_state,
resourceGroupName,
role,
serverName,
start_time,
subscriptionId
FROM azure.sql.vw_replication_links
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new replication_links resource.

/*+ create */
INSERT INTO azure.sql.replication_links (
databaseName,
linkId,
resourceGroupName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ linkId }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

UPDATE example

Updates a replication_links resource.

/*+ update */
UPDATE azure.sql.replication_links
SET
properties = '{{ properties }}'
WHERE
databaseName = '{{ databaseName }}'
AND linkId = '{{ linkId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified replication_links resource.

/*+ delete */
DELETE FROM azure.sql.replication_links
WHERE databaseName = '{{ databaseName }}'
AND linkId = '{{ linkId }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';