这篇文章主要介绍“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怎么实现分布式复制环境”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注百云网站,小编会继续努力为大家带来更多实用的文章!
相关推荐: sqlserver怎么自动备份和自动删除备份过期文件
本篇内容主要讲解“sqlserver怎么自动备份和自动删除备份过期文件”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“sqlserver怎么自动备份和自动删除备份过期文件”吧!https://blog.csdn.ne…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。