如何在不复制数据的情况下创建Oracle表的副本? [英] 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:
- 序列
- 触发
- 索引
- 不能复制一些约束
- 实体化视图日志
- sequences
- triggers
- indices
- some constraints may not be copied
- materialized view logs
这也不处理分区
这篇关于如何在不复制数据的情况下创建Oracle表的副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文