begin
策勒ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联公司的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:028-86922220(备注:SSL证书合作)期待与您的合作!
dbms_job.isubmit(200,'你的物化视图刷新PROCEDURE;',sysdate,'trunc(sysdate,''mi'')+5/1440');
end;
在Oracle9i里,Oracle提供了一个内部事件,用以强制刷新Buffer Cache,其语法为:
alter session set events 'immediate trace name flush_cache level 1';
或者:
alter session set events = 'immediate trace name flush_cache';
类似的也可以使用alter system系统级设置:
alter system set events = 'immediate trace name flush_cache';
在Oracle 10g中,Oracle提供一个新的特性,可以通过如下命令刷新Buffer Cache:
alter system flush buffer_cache;
我们通过试验来看一下刷新Cache的作用:
1.创建测试表
SQL create table t as select * from dba_objects;Table created.SQL analyze table t compute statistics;Table analyzed.SQL select blocks,empty_blocks from dba_tables
2 where table_name='T' and owner='SYS'; BLOCKS EMPTY_BLOCKS
---------- ------------
78 1
表T共有79个Block.
2. x$bh
SQL select count(*) from x$bh; COUNT(*)
----------
14375SQL select count(*) from x$bh where state=0; -- state =0 is free COUNT(*)
----------
13960SQL alter system set events = 'immediate trace name flush_cache';System altered.SQL select count(*) from x$bh where state=0; COUNT(*)
----------
14375
REFRESH FAST
ON DEMAND
START WITH SYSDATE
TRUNC(sysdate) + 1+ (1/24)
NEXT TRUNC(sysdate)+1+13/24
1.建立物化视图;
create materialview myview;
refresh force on demand;
as;
select c1,c2 from table where c150;
2.手动刷新物化视图;
在pl/sql命令窗口输入如下内容,并回车;
execute dbms_mview_refresh('myview','c');