> ## 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.

> Документация по UNDROP TABLE

# UNDROP TABLE

Отменяет удаление таблицы.

Начиная с версии ClickHouse 23.3 можно выполнить UNDROP таблицы в базе данных `Atomic`
в течение периода, заданного параметром [`database_atomic_delay_before_drop_table_sec`](/docs/ru/reference/settings/server-settings/settings/other#database_atomic_delay_before_drop_table_sec) (по умолчанию 8 минут), после выполнения `DROP TABLE`.
Таблицы, удаленные из баз данных `Atomic`, перечислены в `system.dropped_tables`.

Для базы данных `Shared` в ClickHouse Cloud этот период задается параметром [`database_shared_drop_table_delay_seconds`](/docs/ru/reference/settings/session-settings/database#database_shared_drop_table_delay_seconds), который по умолчанию составляет 8 часов.
Таблицы, удаленные из баз данных `Shared`, не перечислены в `system.dropped_tables`.

Если с удаленной таблицей связано materialized view без условия `TO`, вам также потребуется выполнить UNDROP внутренней таблицы этого представления.

<Tip>
  См. также [DROP TABLE](/docs/ru/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:     
```
