分区表添加新的分区

查看原有分区情况 select TABLE_NAME,PARTITION_NAME from user_tab_partitions where table_name='T_PVHISTORY'; TABLE_NAME PARTITION_NAME ------------------------------ ------------------------------ T_PVHISTORY P4 T_PVHISTORY P3 T_PVHISTORY P2 T_PVHISTORY P1 P4是MAXVALUE 2.更改P4名----变成P_LAST alter table T_PVHISTORY rename partition p4 to p_last; 3.分列分区 P_LAST (为什么不用 ADD PARTITION ,因为 如果已有maxvalue分区,不能增加分区,默认ADD PARTITION VALUE必须最大 ,所以可以采取分裂分区的办法增加分区!) alter table T_PVHISTORY split partition p_last at(TO_DATE(' 2009-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) into(partition p4,partition p_last); 4.查看分区信息 select TABLE_NAME,PARTITION_NAME,HIGH_VALUE from user_tab_partitions where table_name='T_PVHISTORY'; TABLE_NAME PARTITION_NAME ------------------------------ ------------------------------ HIGH_VALUE -------------------------------------------------------------------------------- T_PVHISTORY P1 TO_DATE(' 2008-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA T_PVHISTORY P2 TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA T_PVHISTORY P3 TO_DATE(' 2009-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA TABLE_NAME PARTITION_NAME ------------------------------ ------------------------------ HIGH_VALUE -------------------------------------------------------------------------------- T_PVHISTORY P4 TO_DATE(' 2009-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA T_PVHISTORY P_LAST

你可能感兴趣的:(分区表)