About create table as select (CTAS)

孤街醉人 提交于 2019-12-04 09:22:23

Only NOT NULL constraints are copied. See FAQ.

You can do CREATE TABLE big2 (bigid PRIMARY KEY) AS SELECT * FROM big1 tp create a primary key, but yes, for other indexes you'll want to copy and run the index creation scripts.

Just for info, there is a simple way to remember indexes to recreate them after deleting source table:

SELECT DBMS_METADATA.get_ddl('INDEX', index_name)
    FROM user_indexes
    WHERE TABLE_NAME = 'BIG1';
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!