Material View

Oracle Material View

1. Oracle Material View syntax is as below

create materialized view [view_name] 

refresh [fast|complete|force] 

[ on [commit|demand] 

start with (start_time) next (next_time) ] 

as 

{创建物化视图用的查询语句


1. Refresh Method

complete: 全部刷新。相当于重新执行一次创建视图的查询语句。
fast : 增量刷新.假设前一次刷新的时间为t1,那么使用fast模式刷新物化视图时,只向视图中添加t1到当前时间段内,主表变化过的数据.为了记录这种变化,建立增量刷新物化视图还需要一个物化视图日志表。create materialized view log on (主表名)。
force: 这是默认的数据刷新方式。当可以使用fast模式时,数据刷新将采用fast方式;否则使用complete方式。

2. Refresh Type

On demand: 在用户需要时,由用户刷新
On commit: 当主表中有数据提交的时候,立即刷新MV中的数据;

When we need to add schedule, we need to use start with and next
start ……:从指定的时间开始,每隔一段时间(由next指定)就刷新一次;

start with to_date('03-02-2012 14:50:59', 'dd-mm-yyyy hh24:mi:ss') 
next to_date(concat(to_char(sysdate + 1, 'yyyy-MM-dd'), ' 22:00:00'), 'yyyy-MM-dd hh24:mi:ss')   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值