次の方法で共有


Replication Links - Create Or Update

Updates the replication link type.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}?api-version=2024-05-01-preview

URI Parameters

Name In Required Type Description
databaseName
path True

string

The name of the database.

linkId
path True

string

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Request Body

Name Type Description
properties.linkType

ReplicationLinkType

Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.

Responses

Name Type Description
200 OK

ReplicationLink

Successfully updated the replication link.

202 Accepted

Update operation is in progress.

Other Status Codes

ErrorResponse

*** Error Responses: ***

  • 400 ReplicationLinksReplicationLinkNameIsInvalid - Replication link name should be a valid guid.

  • 400 GeoReplicationDatabaseNotSecondary - The operation expects the database to be a replication target.

  • 400 ReplicationLinksReplicationLinkTypeIsInvalid - The LinkType is invalid. Valid values are STANDBY and GEO.

  • 400 ReplicationLinksCreateIsNotSupported - Creation of Replication Link is not supported.

  • 400 LedgerNoDropLink - Geo-replication cannot be stopped because the database has Ledger Digest Uploads enabled. Disable Ledger Digest Uploads and retry the operation.

  • 400 InvalidServerName - Invalid server name specified.

  • 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.

  • 400 TokenTooLong - The provided token is too long.

  • 400 CannotUseTrailingWhitespacesInDatabaseName - The database name validation failed.

  • 400 GeoReplicationDatabaseNotSecondary - The operation expects the database to be a replication target.

  • 400 VBSEnclaveNotSupportedForGeoReplicationWithDefaultEnclave - Configuring geo-replication is not supported for databases using different values of the preferredEnclaveType property. The primary '{0}' database on the '{1}' server uses the '{2}' preferredEnclaveType, whereas the specified preferredEnclaveType for the secondary '{3}' database on the '{4}' server is '{5}'.

  • 400 VBSEnclaveNotSupportedForPlannedFailoverBetweenDatabasesWithDifferentPreferredEnclaveTypes - Planned failover between primary and secondary database with different preferredEnclaveType is not supported for Virtualization-based security (VBS) enclaves.

  • 400 CannotUseReservedDatabaseName - Cannot use reserved database name in this operation.

  • 400 InvalidServerName - Invalid server name specified.

  • 400 PlannedFailoverTimedOut - User invoked planned failover, and it timed out while trying to contact the partner management service.

  • 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.

  • 400 IncorrectReplicationLinkState - The operation expects the database to be in an expected state on the replication link.

  • 404 OperationIdNotFound - The operation with Id does not exist.

  • 404 ResourceNotFound - The requested resource was not found.

  • 404 OperationIdNotFound - The operation with Id does not exist.

  • 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

  • 409 CannotCancelOperation - The management operation is in a state that cannot be cancelled.

  • 409 OperationCancelled - The operation has been cancelled by user.

  • 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

  • 409 InvalidOperationForDatabaseNotInReplicationRelationship - A replication operation was performed on a database that is not in a replication relationship.

  • 409 GeoReplicationCannotBecomePrimaryDuringUndo - User attempted to failover or force-terminate a geo-link while the secondary is in a state where it may not be physically consistent and so cannot enter the primary role.

  • 409 DuplicateGeoDrRelation - The databases are already in a replication relation. This is a duplicate request.

  • 409 UpdateSloInProgress - User tried to initiate an incompatible operation while a SLO update was in progress.

  • 409 ManagementServiceDatabaseBusy - Database '{0}' is busy with another operation. Please try your operation later.

  • 409 ConflictingSystemOperationInProgress - A system maintenance operation is in progress on the database and further operations need to wait until it is completed.

  • 409 FailoverGroupAlreadySetup - The operation cannot be performed because the geo-replication link is part of a Failover Group. You must remove the database from the group in order to individually terminate or failover.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

Examples

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/gamma-db/replicationLinks/00000000-1111-2222-3333-666666666666?api-version=2024-05-01-preview

{
  "properties": {
    "linkType": "STANDBY"
  }
}

Sample response

{
  "properties": {
    "partnerServer": "testsvr",
    "partnerDatabase": "gamma-db",
    "partnerDatabaseId": "/subscriptions/00000000-1111-2222-3333-555555555555/resourceGroups/Second-Default/providers/Microsoft.Sql/servers/testsvr/databases/gamma-db",
    "partnerLocation": "Japan East",
    "role": "Primary",
    "partnerRole": "Secondary",
    "replicationMode": "ASYNC",
    "startTime": "2018-06-21T08:12:43.783Z",
    "percentComplete": 100,
    "replicationState": "CATCH_UP",
    "isTerminationAllowed": true,
    "linkType": "STANDBY"
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/sourcesvr/databases/gamma-db/replicationLinks/4891ca10-ebd0-47d7-9182-c722651780fb",
  "name": "00000000-1111-2222-3333-666666666666"
}
Location: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/locations/japaneast/replicationLinksOperationResults/11111111-1111-1111-1111-111111111111

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ReplicationLink

A replication link.

ReplicationLinkType

Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.

ReplicationRole

Local replication role.

ReplicationState

Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED).

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

A replication link.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.isTerminationAllowed

boolean

Whether the user is currently allowed to terminate the link.

properties.linkType

ReplicationLinkType

Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.

properties.partnerDatabase

string

Resource partner database.

properties.partnerDatabaseId

string

Resource partner database Id.

properties.partnerLocation

string

Resource partner location.

properties.partnerRole

ReplicationRole

Partner replication role.

properties.partnerServer

string

Resource partner server.

properties.percentComplete

integer

Seeding completion percentage for the link.

properties.replicationMode

string

Replication mode.

properties.replicationState

ReplicationState

Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED).

properties.role

ReplicationRole

Local replication role.

properties.startTime

string

Time at which the link was created.

type

string

Resource type.

ReplicationLinkType

Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.

Name Type Description
GEO

string

NAMED

string

STANDBY

string

ReplicationRole

Local replication role.

Name Type Description
Copy

string

NonReadableSecondary

string

Primary

string

Secondary

string

Source

string

ReplicationState

Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED).

Name Type Description
CATCH_UP

string

PENDING

string

SEEDING

string

SUSPENDED

string