在有大量的数据中有部分数据有变化时,采用Fast Refresh方式进行Materialized View Refresh比Complete Refresh方式更高效。因为Complete Refresh 是先truncate materializde view表,然后,将Base表中的所有的记录copy到materializde view表中。而当使用fast refresh这种增量refresh的方式时,需要先建立一个Base表的log表,来记录最近一次materialized view refresh后的base表的所有变更,当fast refresh开始执行时,materialized view表将根据这个log表中的记录(记录了base表中变化过的记录的primary key,以及变更方式,更新,增加或者删除),对materialized view表作相应的更新。
解决方案 »
- 请教个SQL语句
- oracle安装时为断网状态,后来联网后数据库oracledbconsoleorcl出现2错误
- 请各位大虾,帮帮小弟~
- 关于oracle中一个获取数字的问题!
- 安装oracle 时 里面的 编辑配置参数 用户名 密码 等怎么填写
- oracle 8 有没有图形化界面啊?
- 请问哪里有免费下载《ORACLE8 PL/SQL程序设计》这本书的?(虽然有很多网站提供下载,可是都无法正确下载)
- 输入一个日期,如何把这一日期所在的季度全部数据查出来?
- 关于oracle function 的exec运行出错问题
- PLSQL执行脚本时怎么去除重复的数据
- 关于Oracle的SQL*Plus的基本问题
- 求助!!关于extent的管理方式!!
但是最好升级pack到9.2.7,否则有问题。
如果米很多,建议用advanced replication将会得到更好的性能。
不过具体还是要看,每天的数据变更量有多少
如果有一半数据要更新的话
用Fast方式反而会得不偿失
Materialized views can be refreshed using COMPLETE, FAST, FORCE, ON DEMAND or ON COMMIT depending on the complexity of the materialized view. A COMPLETE truncates the materialized view table and reloads it from scratch. A FAST uses a materialized view log to only update changed rows. If you intend to use the FAST refresh method, you must create the materialized view log first and then the materialized view. A FORCE will perform a FAST if possible and a COMPLETE if required. ON DEMAND uses the DBMS_MVIEW or DBMS_SNAP packages to complete a refresh and ON COMMIT refreshes a materialized view or snapshot whenever a commit is executed against the base table (for a simple materialized view with no joins or aggregations.)
Oracle8i provides a procedure, DBMS_SNAPSHOT.REFRESH_ALL_MVIEWS which handles refresh activity on materialized views on demand.