可更新物化视图复制站点
1.即使从主站点或主物化视图站点断开,用户也能够查询和更新本地站点已复制的数据集(data set)。2.相对于多主站点的复制,要求
可更新物化视图说明
1.可更新的物化视图必须属于一个物化视图组。
2.可更新的物化视图总是基于单表,尽管能够在子查询中引用多个表。
3.可更新的物化视图能够快速刷新。
4.Oracle将可更新MV的改变传播到远程主表或主物化视图,远程主表的改变同样会传播到所有的复制站点。
5.当创建可更新的物化视图时,不要使用列别名(column aliases),,否则使用CREATE_MVIEW_REPOBJECT过程将物化视图添加到物化视图组时会导致错误。
6.可更新的物化视图不会自动使用主表或主物化视图列默认值。
可更新物化视图带来的益处
1.即使从主站点或主物化视图站点断开,用户也能够查询和更新本地站点已复制的数据集(data set)。
2.相对于多主站点的复制,要求更少的资源,却仍然支持数据的更新操作。
3.相对于多主站点的复制,降低了网络资源的压力,因为物化视图可以按需求进行刷新(refreshed on demand),而多主站点复制以定期的间隔(regular intervals)来传播改变。
可更新物化视图站点结构图
This image shows that client applications can query and update an updatable materialized view at the materialized view site. These applications can also update data at the master. When the materialized view refreshes, the materialized view is updated with the changes at the master and the master is updated with the changes at the materialized view.
注意点:
Before you build materialized view environments, you must set up your master site, create a master group, and set up your intended materialized view sites. Also, if conflicts are possible at the master site due to activity at the materialized view sites you are creating, then configure conflict resolution for the master tables of the materialized views before you create the materialized view group.
1.Setting Up Master Sites
2.Setting Up Materialized View Sites
3.Create a Master Group
4.Create Materialized View Group
具体的操作步骤可以参考:
Advanced Replication Management API Reference
主组(master group)复制过程与静默过程
SUSPEND_MASTER_ACTIVITY Procedure
This procedure suspends replication activity for a master group. You use this procedure toquiesce the master group. You must call this procedure from the master definition site.
DBMS_REPCAT.SUSPEND_MASTER_ACTIVITY (
gname IN VARCHAR2);
RESUME_MASTER_ACTIVITY Procedure
This procedure resumes normal replication activity after quiescing a replication environment.
DBMS_REPCAT.RESUME_MASTER_ACTIVITY (
gname IN VARCHAR2,
override IN BOOLEAN := false);
参考:
Overview of Updatable Materialized Views
Updatable Materialized Views
推荐阅读