189 8069 5689

materializedview怎么实现分布式复制环境

这篇文章主要介绍“materialized view怎么实现分布式复制环境”,在日常操作中,相信很多人在materialized view怎么实现分布式复制环境问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”materialized view怎么实现分布式复制环境”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

10年积累的做网站、成都网站制作经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站策划后付款的网站建设流程,更有马山免费网站建设让你可以放心的选择与我们合作。

################################分布式环境下通过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怎么实现分布式复制环境”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!


分享标题:materializedview怎么实现分布式复制环境
路径分享:http://jkwzsj.com/article/jeigpi.html

其他资讯