您好,登錄后才能下訂單哦!
這篇文章主要介紹“materialized view怎么實現分布式復制環境”,在日常操作中,相信很多人在materialized view怎么實現分布式復制環境問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”materialized view怎么實現分布式復制環境”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
################################分布式環境下通過materialized view實現表高級復制
1.在主站點建立snapproxy用戶
create user snapproxy identified by "snap001snap" default tablespace users;
BEGIN
dbms_repcat_admin.register_user_repgroup(
username => 'snapproxy',
privilege_type => 'proxy_snapadmin',
list_of_gnames => NULL);
END;
/
grant create session,select any table to snapproxy;
2.在主站點以要復制表的屬主創建表的物化視圖日志:(這里為hr用戶)
conn hr/hr;
create snapshot log on employees with rowid,primary key;
create snapshot log on departments with rowid,primary key;
3.在物化視圖站點創建復制表的目標用戶:
create user mview identified by mview default tablespace usres;
grant connect,resource,create snashot,create database link to mview;
4.在物化視圖站點創建物化視圖刷新用戶并賦權:
create user snapadmin identified by "snap001snap" default tablespace users;
EXECUTE dbms_repcat_admin.grant_admin_any_schema('snapadmin');
grant comment any table,lock any table,create any materialized view,alert any materialized view to snapadmin;
5.在物化視圖站點以物化視圖用戶mview創建到snapproxy用戶的dblink及物化視圖:
create database link presale connect to snapproxy identified by "snap001snap" using '130.84.208.52:1621/presale';
create materialized view employees_mv refresh fast as select * from hr.employees@presale;
create materialized view departments_mv refresh fast as select * from hr.departments@presale;
6.snapadmin用戶創建刷新組
begin
dbms_refresh.make(
name => 'RG_MVIEW_OWNER',
list => 'mview.employees_mv,mview.departments_mv',
next_date => sysdate,
interval => 'SYSDATE + 1/1440',
implicit_destroy => true,
lax => true);
end;
/
7.初始化刷新
execute dbms_refresh.refresh('RG_MVIEW_OWNER');
到此,關于“materialized view怎么實現分布式復制環境”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。