可更新物化視圖說明
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 to
quiesce 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
http://docs.oracle.com/cd/B19306_01/server.102/b14226/repoverview.htm#sthref53
Updatable Materialized Views
http://docs.oracle.com/cd/B19306_01/server.102/b14226/repmview.htm#sthref396