> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# configurações de sessão alter_*

> Configurações de sessão do ClickHouse no grupo gerado alter_*.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Tipo</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Padrão</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Pode ser alterado sem reiniciar
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

Essas configurações estão disponíveis em [system.settings](/docs/pt-BR/reference/system-tables/settings) e são autogeradas a partir do [código-fonte](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

<div id="alter_move_to_space_execute_async">
  ## alter\_move\_to\_space\_execute\_async
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

Executa ALTER TABLE MOVE ... TO \[DISK|VOLUME] de forma assíncrona

<div id="alter_partition_verbose_result">
  ## alter\_partition\_verbose\_result
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

Ativa ou desativa a exibição de informações sobre as partes às quais as operações de manipulação de partições e partes foram aplicadas com sucesso.
Aplicável a [ATTACH PARTITION|PART](/docs/pt-BR/reference/statements/alter/partition#attach-partitionpart) e a [FREEZE PARTITION](/docs/pt-BR/reference/statements/alter/partition#freeze-partition).

Valores possíveis:

* 0 — desativa a verbosidade.
* 1 — ativa a verbosidade.

**Exemplo**

```sql theme={null}
CREATE TABLE test(a Int64, d Date, s String) ENGINE = MergeTree PARTITION BY toYYYYMDECLARE(d) ORDER BY a;
INSERT INTO test VALUES(1, '2021-01-01', '');
INSERT INTO test VALUES(1, '2021-01-01', '');
ALTER TABLE test DETACH PARTITION ID '202101';

ALTER TABLE test ATTACH PARTITION ID '202101' SETTINGS alter_partition_verbose_result = 1;

┌─command_type─────┬─partition_id─┬─part_name────┬─old_part_name─┐
│ ATTACH PARTITION │ 202101       │ 202101_7_7_0 │ 202101_5_5_0  │
│ ATTACH PARTITION │ 202101       │ 202101_8_8_0 │ 202101_6_6_0  │
└──────────────────┴──────────────┴──────────────┴───────────────┘

ALTER TABLE test FREEZE SETTINGS alter_partition_verbose_result = 1;

┌─command_type─┬─partition_id─┬─part_name────┬─backup_name─┬─backup_path───────────────────┬─part_backup_path────────────────────────────────────────────┐
│ FREEZE ALL   │ 202101       │ 202101_7_7_0 │ 8           │ /var/lib/clickhouse/shadow/8/ │ /var/lib/clickhouse/shadow/8/data/default/test/202101_7_7_0 │
│ FREEZE ALL   │ 202101       │ 202101_8_8_0 │ 8           │ /var/lib/clickhouse/shadow/8/ │ /var/lib/clickhouse/shadow/8/data/default/test/202101_8_8_0 │
└──────────────┴──────────────┴──────────────┴─────────────┴───────────────────────────────┴─────────────────────────────────────────────────────────────┘
```

<div id="alter_sync">
  ## alter\_sync
</div>

**Aliases**: `replication_alter_partitions_sync`

<SettingsInfoBlock type="UInt64" default_value="1" />

Permite especificar o comportamento de espera para ações que devem ser executadas em réplicas por consultas [`ALTER`](/docs/pt-BR/reference/statements/alter/index), [`OPTIMIZE`](/docs/pt-BR/reference/statements/optimize) ou [`TRUNCATE`](/docs/pt-BR/reference/statements/truncate).

Valores possíveis:

* `0` — Não aguardar.
* `1` — Aguardar a própria execução.
* `2` — Aguardar todas.
* `3` - Aguardar apenas as réplicas ativas.

Valor padrão no Cloud: `0`.

<Note>
  `alter_sync` se aplica apenas a tabelas `Replicated` e `SharedMergeTree`; não tem efeito ao alterar tabelas que não sejam `Replicated` ou `Shared`.
</Note>

<div id="alter_update_mode">
  ## alter\_update\_mode
</div>

<SettingsInfoBlock type="AlterUpdateMode" default_value="heavy" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.5"},{"label": "heavy"},{"label": "Nova configuração"}]}]} />

Modo para consultas `ALTER` com comandos `UPDATE`.

Valores possíveis:

* `heavy` - executa a mutação regular.
* `lightweight` - executa atualização leve, se possível; caso contrário, executa a mutação regular.
* `lightweight_force` - executa atualização leve, se possível; caso contrário, lança uma exceção.
