首页 > 数据库技术 > 详细

ORACLE建立物化视图

时间:2017-10-21 23:21:08      阅读:256      评论:0      收藏:0      [点我收藏+]
       
--使用 on commit 的方式建立物化视图  
create materialized view emp_dept refresh on commit 
as 
select t.*,d.dname from emp t , dept d
       where  t.deptno  = d.deptno;      
       
--使用 on demand的方式建立物化视图
create materialized view mv_name refresh force on demand start with sysdate 
       next to_date( concat( to_char( sysdate+1,dd-mm-yyyy), 22:00:00),dd-mm-yyyy hh24:mi:ss)
              as 
select t.*,d.dname  from emp t 
       left join dept d
       on t.deptno  = d.deptno;
       
--用left join 不能使用 on commit 的刷新方式,但是能使用 on demand的刷新方式
create materialized view emp_dept1 refresh force on commit 
as 
select t.*,d.dname  from emp t 
       left join dept d
       on t.deptno  = d.deptno;

 

ORACLE建立物化视图

原文:http://www.cnblogs.com/yhoralce/p/7706549.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!