oracle how to alter table add partition by range interval

余生长醉 提交于 2019-12-11 03:26:31

问题


i have searched a lot but i have found nothing about how to add a range partition to an existing table

alter table myuser.mytable
add PARTITION  BY RANGE (mynumber) INTERVAL (1)
( PARTITION p1 VALUES LESS THAN (108))  

that gives me ORA:14150 error, SUBPARTITON keyword is missing, but i dont want to give subpartition


回答1:


If your existing Table is Non-Partitioned you will have to:

  1. CREATE a new TABLE with partition definitions. Lets call this table MYTABLE_NEW
  2. INSERT into MYTABLE_NEW all data from MYTABLE
  3. RENAME MYTABLE to MYTABLE_OLD
  4. RENAME MYTABLE_NEW to MYTABLE
  5. DROP MYTABLE_OLD

OR

dbms_redefinition can also be used

See this from AskTom

Also see this other Answer



来源:https://stackoverflow.com/questions/40890495/oracle-how-to-alter-table-add-partition-by-range-interval

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!