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

# REPAIR TABLE

<a id="sql-repair-table" />

Repairs one or more corrupted tables.  Tables are specified as a comma-separated
list of table names.

```sql title="REPAIR TABLE Syntax" theme={null}
REPAIR TABLE[S] [<schema name>.]<table name>[,...]
WITH OPTIONS (REPAIR_POLICY = '<repair type>')
```

## Parameters

<AccordionGroup>
  <Accordion title="<schema name>" id="<schema-name>" defaultOpen>
    Name of the *schema* containing the table to repair
  </Accordion>

  <Accordion title="<view name>" id="<view-name>" defaultOpen>
    Name of the *table* to repair
  </Accordion>

  <Accordion title="REPAIR_POLICY" id="repair_policy" defaultOpen>
    Specifies the type of *table* repair to perform.  The following are available:

    <div>
      <table class="table w-full [&_td]:min-w-[150px] [&_th]:text-left [&_td[data-numeric]]:tabular-nums">
        <thead>
          <tr>
            <th>Type</th>
            <th>Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td><code>delete\_chunks</code></td>
            <td>Deletes any corrupted chunks</td>
          </tr>

          <tr>
            <td><code>shrink\_columns</code></td>
            <td>Shrinks corrupted chunks to the shortest column</td>
          </tr>

          <tr>
            <td><code>replay\_wal</code></td>
            <td>Manually invokes WAL replay on the *table*</td>
          </tr>
        </tbody>
      </table>
    </div>
  </Accordion>
</AccordionGroup>

## Examples

To manually replay the WAL on two tables:

```sql REPAIR TABLE Example theme={null}
REPAIR TABLES example.rt_product, example.rt_order
WITH OPTIONS (REPAIR_POLICY = 'replay_wal')
```
