Oracle分割槽表增加分割槽報錯“ORA-14760:不允許對間隔分割槽物件執行 ADD PARTITION”

feelpurple發表於2016-05-18
為分割槽表增加分割槽的時候報錯


檢視報錯程式碼
[oracle@backup-recovery misdb]$ oerr ora 14120
14120, 00000, "incompletely specified partition bound for a DATE column"
// *Cause:  An attempt was made to use a date expression whose format 
//          does not fully (i.e. day, month, and year (including century))
//          specify a date as a partition bound for a DATE column.
//          The format may have been specified explicitly (using
//          TO_DATE() function) or implicitly (NLS_DATE_FORMAT).
// *Action: Ensure that date format used in a partition bound for a
//          DATE column supports complete specification of a date
//          (i.e. day, month, and year (including century)).  
//          If NLS_DATE_FORMAT does not support complete 
//          (i.e. including the century) specification of the year,
//          use TO_DATE() (e.g. TO_DATE('01-01-1999', 'MM-DD-YYYY') 
//          to fully express the desired date.

報錯原因:增加的分割槽時間格式和分割槽中指定的時間格式不匹配

檢視分割槽表中的各分割槽時間格式


解決方法:使用分割槽表中的分割槽時間格式
alter table ELMP_TRANS_SALEDETAIL
add partition p_20161201 values less than
(TO_DATE(' 2016-12-01 23:59:59', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'));

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2102452/,如需轉載,請註明出處,否則將追究法律責任。

相關文章