问题
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:
CREATEa newTABLEwithpartitiondefinitions. Lets call this tableMYTABLE_NEWINSERTintoMYTABLE_NEWall data fromMYTABLERENAMEMYTABLEtoMYTABLE_OLDRENAMEMYTABLE_NEWtoMYTABLEDROPMYTABLE_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