---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/alter-async-replication.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/alter-async-replication.md
sourcePath: en/core/yql/reference/syntax/alter-async-replication.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# ALTER ASYNC REPLICATION

The `ALTER ASYNC REPLICATION` statement modifies the status and parameters of an [asynchronous replication instance](https://ydb.tech/docs/en/concepts/async-replication.md).

## Syntax {#syntax}

```yql
ALTER ASYNC REPLICATION <name> SET (option = value [, ...])
```

### Parameters {#params}

* `name` — a name of the asynchronous replication instance.
* `SET (option = value [, ...])` — asynchronous replication parameters:

    * `STATE` — the state of asynchronous replication. This parameter can only be used in combination with the `FAILOVER_MODE` parameter (see below). Valid values are:

        * `DONE` — [completion of the asynchronous replication process](https://ydb.tech/docs/en/concepts/async-replication.md#done).

    * `FAILOVER_MODE` — the mode for changing the replication state. This parameter can only be used in combination with the `STATE` parameter. Valid values are:

        * `FORCE` — forced failover.

* Authentication settings for the source database (one of the following):

  <!-- source: en/yql/reference/syntax/_includes/async_replication_authentification.md -->
  * Using a [token](https://ydb.tech/docs/en/recipes/ydb-sdk/auth-access-token.md):

      * `TOKEN_SECRET_PATH` — the [secret](https://ydb.tech/docs/en/concepts/datamodel/secrets.md) that contains the token.

  * Using a [username and password](https://ydb.tech/docs/en/recipes/ydb-sdk/auth-static.md):

      * `USER` — the username.
      * `PASSWORD_SECRET_PATH` — the [secret](https://ydb.tech/docs/en/concepts/datamodel/secrets.md) that contains the password.

  * Using a [delegated service account](https://yandex.cloud/ru/docs/iam/concepts/service-control):

      * `SERVICE_ACCOUNT_ID` — the identificator of the service account.
      * `INITIAL_TOKEN_SECRET_PATH` — the [secret](https://ydb.tech/docs/en/concepts/datamodel/secrets.md) that contains the account's token. It is used for initial authentication.
  <!-- endsource: en/yql/reference/syntax/_includes/async_replication_authentification.md -->

## Examples {#examples}

The following statement forces the asynchronous replication process to complete:

```yql
ALTER ASYNC REPLICATION my_replication SET (STATE = "DONE", FAILOVER_MODE = "FORCE");
```

The following query changes the secret:

```yql
ALTER ASYNC REPLICATION my_replication SET (TOKEN_SECRET_PATH = "my_token");
```

## See also

* [CREATE ASYNC REPLICATION](https://ydb.tech/docs/en/yql/reference/syntax/create-async-replication.md)
* [DROP ASYNC REPLICATION](https://ydb.tech/docs/en/yql/reference/syntax/drop-async-replication.md)
