How can I create a copy of an Oracle table without copying the data?(如何在不复制数据的情况下创建 Oracle 表的副本?)
问题描述
我知道声明:
create table xyz_new as select * from xyz;
哪个复制结构和数据,但如果我只想要结构呢?
Which copies the structure and the data, but what if I just want the structure?
推荐答案
只需使用一个不会选择任何行的 where 子句:
Just use a where clause that won't select any rows:
create table xyz_new as select * from xyz where 1=0;
限制
以下内容不会被复制到新表中:
Limitations
The following things will not be copied to the new table:
- 序列
- 触发器
- 索引
- 某些约束可能无法复制
- 物化视图日志
这也不处理分区
这篇关于如何在不复制数据的情况下创建 Oracle 表的副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!