> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> UNDROP TABLE のドキュメント

# UNDROP TABLE

テーブルの削除を取り消します。

ClickHouse バージョン 23.3 以降では、Atomic データベース内のテーブルについて、DROP TABLE ステートメントの実行から `database_atomic_delay_before_drop_table_sec` (デフォルトでは 8 分) 以内であれば、UNDROP できます。削除されたテーブルは、`system.dropped_tables` という system table に一覧表示されます。

削除されたテーブルに、`TO` 句を持たない materialized view が関連付けられている場合は、その view の内部テーブルについても UNDROP する必要があります。

<Tip>
  [DROP TABLE](/ja/reference/statements/drop) も参照してください。
</Tip>

構文:

```sql theme={null}
UNDROP TABLE [db.]name [UUID '<uuid>'] [ON CLUSTER cluster]
```

**例**

```sql theme={null}
CREATE TABLE tab
(
    `id` UInt8
)
ENGINE = MergeTree
ORDER BY id;

DROP TABLE tab;

SELECT *
FROM system.dropped_tables
FORMAT Vertical;
```

```response theme={null}
Row 1:
──────
index:                 0
database:              default
table:                 tab
uuid:                  aa696a1a-1d70-4e60-a841-4c80827706cc
engine:                MergeTree
metadata_dropped_path: /var/lib/clickhouse/metadata_dropped/default.tab.aa696a1a-1d70-4e60-a841-4c80827706cc.sql
table_dropped_time:    2023-04-05 14:12:12

1 row in set. Elapsed: 0.001 sec. 
```

````sql theme={null}
UNDROP TABLE tab;

SELECT *
FROM system.dropped_tables
FORMAT Vertical;

```response
Ok.

0 rows in set. Elapsed: 0.001 sec. 
````

```sql theme={null}
DESCRIBE TABLE tab
FORMAT Vertical;
```

```response theme={null}
Row 1:
──────
name:               id
type:               UInt8
default_type:       
default_expression: 
comment:            
codec_expression:   
ttl_expression:     
```
