> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.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` 的系统表中。

如果你有一个与已删除表关联且不带 `TO` 子句的 materialized view，那么还需要对该视图的内部表执行 UNDROP。

<Tip>
  另请参见 [DROP TABLE](/zh/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:     
```
