一、在sffw用户下建立表yh_qfcx的快照日志;
---- 只有先建立表yh_qfcx的快照日志,才能在快照中执行快速刷新。
---- Create snapshot log on yh_qfcx;
二、在dmtcx用户下建立到sffw用户的数据库链link_sf;
---- 建立了到sffw用户的数据库链后才能从sffw用户下的表yh_qfcx中获取数据。
---- Create database link link_sf
---- Connect to sffw identified by xxxxxxx using 'rs6000';
三、在dmtcx用户下建立快照s_yh_qfcx;
Create snapshot s_yh_qfcx as
Select yhh,qf6+qf5+qf4+qf3+qf2+qf1+qf qfje
From yh_qfcx@link_sf
Where tjbz='K' and bz6+bz5+bz4+bz3+bz2+bz1+bz>0;
Alter snapshot s_yh_qfcx refresh fast
Start with sysdate+1/1440 next sysdate+1/144;
{此SQL语句的意思为:设定oracle自动在1分钟
(1/24*60)后进行第一次快速刷新,以后每隔10分钟
(10/24*60)快速刷新一次。}
Alter snapshot s_yh_qfcx refresh complete
Start with sysdate+1/2880 next sysdate+1;
{此SQL语句的意思为:设定oracle自动在30钞
(30/24*60*60)后进行第一次完全刷新,
以后每隔1天完全刷新一次。}