ORA-30078: partition bound must be TIME/TIMESTAMP WITH TIME ZONE literals
11g Release 2 (11.2)

Example 4-9 Creating reference-partitioned tables

CREATE TABLE orders ( order_id NUMBER(12), order_date TIMESTAMP WITH LOCAL TIME ZONE, order_mode VARCHAR2(8), customer_id NUMBER(6), order_status NUMBER(2), order_total NUMBER(8,2), sales_rep_id NUMBER(6), promotion_id NUMBER(6), CONSTRAINT orders_pk PRIMARY KEY(order_id) ) PARTITION BY RANGE(order_date) ( PARTITION Q1_2005 VALUES LESS THAN (TO_DATE('01-APR-2005','DD-MON-YYYY')), PARTITION Q2_2005 VALUES LESS THAN (TO_DATE('01-JUL-2005','DD-MON-YYYY')), PARTITION Q3_2005 VALUES LESS THAN (TO_DATE('01-OCT-2005','DD-MON-YYYY')), PARTITION Q4_2005 VALUES LESS THAN (TO_DATE('01-JAN-2006','DD-MON-YYYY')) ); 

ERROR at line 13:
ORA-30078: partition bound must be TIME/TIMESTAMP WITH TIME ZONE literals

尝试解决如下步骤:
1.表中字段类型更改
a  
order_date TIMESTAMP
 创建成功
b  
order_date date
  创建成功

2. 
 PARTITION value 类型更改
a   
VALUES LESS THAN (TO_DATE('2016-06-01','YYYY-MM-DD'))
创建失败
b   
VALUES LESS THAN (timestamp'2016-06-01 00:00:00.000000')
创建失败
c  
 VALUES LESS THAN (timestamp('2016-06-01 00:00:00.000000','yyyy-mm-dd hh24:mi:ss.ff')) 
创建失败
d  
 VALUES LESS THAN (cast(to_date('2016-07-01','yyyy-mm-dd') as timestamp))
创建失败
e   
VALUES LESS THAN (TO_TIMESTAMP_TZ('2016-06-01 00:12:56.788 -12:44', 'YYYY-MM-DD HH24:MI:SS.FF TZH:TZM'))
 创建成功

以上为运行结果。
下面是参数信息,在下面两台数据库中测试,以上运行结果都相同。
NLS_LANGUAGE=SIMPLIFIED CHINESE
NLS_TERRITORY=CHINA

 NLS_LANGUAGE=AMERICAN
NLS_TERRITORY=AMERICA
阅读更多
个人分类: 数据库笨鸟日记
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

ORA-30078: partition bound must be TIME/TIMESTAMP WITH TIME ZONE literals

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭