如何在不复制数据的情况下创建 Oracle 表的副本? [英] How can I create a copy of an Oracle table without copying the data?

查看:33
本文介绍了如何在不复制数据的情况下创建 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 表的副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆