Oracle 11gR2中的分区物化视图

时间:2013-11-18 08:47:57

标签: oracle

我正在尝试创建一个分区的物化视图,但它失败了 错误ora-00933

create materialized view my_mv
  refresh fast with rowid
  enable query rewrite
 as
select sal_dt ,
sum(sales) sum_sales
from sales
group by sal_dt
partition by range (sal_dt)
interval (numtodsinterval(1,'day'))
(partition p_sal_dt_min values less than (to_date(' 2013-11-18 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian'))

partition by range (sal_dt)
*
error at line 10:
ora-00933: sql command not properly ended

任何想法我在这里缺少什么

1 个答案:

答案 0 :(得分:4)

物理属性在查询之前。在“启用查询重写”(reference)之后移动PARTITION BY ...子句。