> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/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 VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["Versão", "Valor padrão", "Comentário"];
  const border = "1px solid rgba(128, 128, 128, 0.3)";
  const cell = {
    border,
    padding: "0.25rem 0.5rem",
    textAlign: "start",
    verticalAlign: "top"
  };
  return <details className="not-prose" style={{
    border,
    borderRadius: "0.5rem",
    margin: "0.5rem 0",
    padding: "0.5rem 0.75rem",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <summary style={{
    cursor: "pointer",
    fontWeight: 600,
    opacity: 0.72
  }}>
        Histórico de versões
      </summary>
      <table style={{
    borderCollapse: "collapse",
    width: "100%",
    margin: "0.5rem 0 0"
  }}>
        <thead>
          <tr>
            {headers.map(header => <th key={header} style={{
    ...cell,
    fontWeight: 600,
    opacity: 0.72
  }}>
                {header}
              </th>)}
          </tr>
        </thead>
        <tbody>
          {rows.map((row, row_index) => <tr key={row.id ?? row_index}>
              {(row.items ?? []).map((item, item_index) => <td key={item_index} style={{
    ...cell,
    overflowWrap: "anywhere"
  }}>
                  {item?.label}
                </td>)}
            </tr>)}
        </tbody>
      </table>
    </details>;
};

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](/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](/pt-BR/reference/statements/alter/partition#attach-partitionpart) e a [FREEZE PARTITION](/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`](/pt-BR/reference/statements/alter/index), [`OPTIMIZE`](/pt-BR/reference/statements/optimize) ou [`TRUNCATE`](/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" />

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.
