الانتقال إلى المحتوى الرئيسي
يلغي إسقاط الجدول. اعتبارًا من إصدار ClickHouse 23.3، يمكن تنفيذ UNDROP لجدول في قاعدة بيانات Atomic خلال database_atomic_delay_before_drop_table_sec (8 دقائق افتراضيًا) بعد إصدار عبارة DROP TABLE. تُدرَج الجداول التي أُسقِطت في جدول نظام يُسمى system.dropped_tables. إذا كان لديك عرض مادي من دون عبارة TO مرتبط بالجدول المُسقَط، فستحتاج أيضًا إلى تنفيذ UNDROP للجدول الداخلي لهذا العرض.
راجع أيضًا DROP TABLE
الصيغة:
UNDROP TABLE [db.]name [UUID '<uuid>'] [ON CLUSTER cluster]
مثال
CREATE TABLE tab
(
    `id` UInt8
)
ENGINE = MergeTree
ORDER BY id;

DROP TABLE tab;

SELECT *
FROM system.dropped_tables
FORMAT Vertical;
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. 
UNDROP TABLE tab;

SELECT *
FROM system.dropped_tables
FORMAT Vertical;

```response
Ok.

0 rows in set. Elapsed: 0.001 sec. 
DESCRIBE TABLE tab
FORMAT Vertical;
Row 1:
──────
name:               id
type:               UInt8
default_type:       
default_expression: 
comment:            
codec_expression:   
ttl_expression:     
آخر تعديل في ٢٥ يونيو ٢٠٢٦