Adding partitions 11g/12c - Oracle Database Script. -- SYNTAX : ALTER TABLE <SCHEMA_NAME>.<TABLE_NAME> ADD PARTITION < PARTITION_NAME> VALUES LESS THAN < HIGH_VALUE> TABLESPACE <TABLESPACE_NAME > < UPDATE GLOBAL INDEXES(optional)>; -- NOTE: UPDATE GLOBAL INDEXES is required if GLOBAL INDEX is present ALTER TABLE CMADMIN.AODBA ADD PARTITION AODBA_JAN VALUES LESS THAN (TO_DATE('01-FEB-2016','DD-MON-YYYY')) TABLESPACE USERS UPDATE GLOBAL INDEXES; -- In oracle 12c(new feature), we can add multiple partition in one command: ALTER TABLE CMADMIN.AODBA ADD PARTITION AODBA_JAN VALUES LESS THAN (TO_DATE('01-FEB-2016','DD-MON-YYYY')) TABLESPACE USERS, PARTITION AODBA_FEB VALUES LESS THAN (TO_DATE('01-MAR-2016','DD-MON-YYYY')) TABLESPACE USERS, PARTITION AODBA_MAR VALUES LESS THAN (TO_DATE('01-APR-2016','DD-MON-YYYY')) TABLESPACE USERS, UPDATE GLOBAL INDEXES;
-- SYNTAX : ALTER TABLE <SCHEMA_NAME>.<TABLE_NAME> ADD PARTITION < PARTITION_NAME> VALUES LESS THAN < HIGH_VALUE> TABLESPACE <TABLESPACE_NAME > < UPDATE GLOBAL INDEXES(optional)>; -- NOTE: UPDATE GLOBAL INDEXES is required if GLOBAL INDEX is present ALTER TABLE CMADMIN.AODBA ADD PARTITION AODBA_JAN VALUES LESS THAN (TO_DATE('01-FEB-2016','DD-MON-YYYY')) TABLESPACE USERS UPDATE GLOBAL INDEXES; -- In oracle 12c(new feature), we can add multiple partition in one command: ALTER TABLE CMADMIN.AODBA ADD PARTITION AODBA_JAN VALUES LESS THAN (TO_DATE('01-FEB-2016','DD-MON-YYYY')) TABLESPACE USERS, PARTITION AODBA_FEB VALUES LESS THAN (TO_DATE('01-MAR-2016','DD-MON-YYYY')) TABLESPACE USERS, PARTITION AODBA_MAR VALUES LESS THAN (TO_DATE('01-APR-2016','DD-MON-YYYY')) TABLESPACE USERS, UPDATE GLOBAL INDEXES;