connect system/passwd@SH create user repadmin identified by repadmin; begin dbms_repcat_admin.grant_admin_any_schema( username=>’repadmin’); end; /grant comment any table to REPADMIN; grant lock any table to REPADMIN;
后面的兩個(gè)grant語句使復(fù)制治理員可以為任何表建立實(shí)體化視圖日志。假如想改用戶可以使用視圖治理器,還需要下面的命令: grant select any dictionary to REPADMIN; 2.注冊傳播方,傳播方會(huì)將主體站點(diǎn)的延遲事務(wù)隊(duì)列推入其他主體站點(diǎn)或者實(shí)體化視圖站點(diǎn)。
begin dbms_defer_sys.register_purpagator(username=>’repadmin’); end;
disconnect; connect system/passwd@BJ; create user mvadmin identified by mvadmin; begin dbms_repcat_admin. grant_admin_any_schema(username=> ’mvadmin’); end; /grant comment any table to mvadmin; grant lock any table to mvadmin; grant select any dictionary to mvadmin;
2.注冊傳播方:
begin dbms_defer_sys.register_propagator( username => ’mvadmin’); end; /
disconnect; connect system/passwd@BJ; grant alter session to crm; grant create cluster to crm; grant create database link to crm; grant create sequence to crm; grant create session to crm; grant create synonym to crm; grant create table to crm; grant create view to crm; grant create procedure to crm; grant create trigger to crm; grant unlimited tablespace to crm; grant create type to crm; grant create any snapshot to crm; grant alter any snapshot to crm;
8.建立復(fù)制方案的數(shù)據(jù)庫連接:
disconnect; connect SHORACL/SHORACL@BJ; create database link ORACLSH connect to ORACL identified by ORACL;
disconnect; connect mvadmin/mvadmin@BJ; create materialized view SHORACL.CREDIT_CARD refresh fast wit h pr imar y key as sele ct * from ORA CL. CREDIT_CARD@ORACLSH;
@后面是數(shù)據(jù)庫連接名。假如該表沒有主鍵則使用rowid來刷新。
create materialized view SHORACL. CREDIT_CARD refresh fast with rowid as select * from ORACL. CREDIT_CARD@ORACLSH;