Oracle中利用EXP/IMP工具实现数据迁移(5)
http://www.itjxue.com 2015-07-17 10:50 来源:未知 点击次数:
建立物化视图,完成复制环境的配置:
SQL> CONNECT YANGTK/YANGTK@RAC1已连接。 SQL> CREATE MATERIALIZED VIEW LOG ON T; |
实体化视图日志已创建。
SQL> CREATE MATERIALIZED VIEW LOG ON T1; |
实体化视图日志已创建。
SQL> CONNECT SYSTEM/TEST@TESTMV已连接。 SQL> CREATE USER YANGTK IDENTIFIED BY YANGTK DEFAULT TABLESPACE NDMAIN; |
用户已创建。
SQL> GRANT CREATE SESSION, CREATE TABLE, CREATE PROCEDURE, CREATE SEQUENCE, 2 CREATE TRIGGER, CREATE VIEW, CREATE SYNONYM, ALTER SESSION, 3 CREATE MATERIALIZED VIEW, ALTER ANY MATERIALIZED VIEW, 4 CREATE DATABASE LINK TO YANGTK; |
授权成功。
SQL> GRANT CONNECT, RESOURCE TO YANGTK; |
授权成功。
SQL> CONNECT YANGTK/YANGTK@TESTMV已连接。 SQL> CREATE DATABASE LINK RAC1.US.ORACLE.COM CONNECT TO REPADMIN IDENTIFIED BY REPADMIN; |
数据库链接已创建。
SQL> CONNECT MVADMIN/MVADMIN@TESTMV已连接。 SQL> BEGIN 2 DBMS_REPCAT.CREATE_MVIEW_REPGROUP(GNAME => 'REP_GROUP', MASTER => 'RAC1.US.ORACLE.COM', 3 PROPAGATION_MODE => 'ASYNCHRONOUS'); 4 END; 5 / |
PL/SQL 过程已成功完成。
SQL> BEGIN 2 DBMS_REFRESH.MAKE(NAME => 'YANGTK.REP_REFRESH', LIST => '', NEXT_DATE => SYSDATE, 3 INTERVAL => 'SYSDATE + 1/48', IMPLICIT_DESTROY => FALSE, ROLLBACK_SEG => '', PUSH_DEFERRED_RPC => FALSE, 4 REFRESH_AFTER_ERRORS => FALSE); 5 END; 6 / |
PL/SQL 过程已成功完成。
SQL> CREATE MATERIALIZED VIEW 2 YANGTK.T REFRESH FAST WITH PRIMARY KEY 3 AS SELECT * FROM YANGTK.T@RAC1.US.ORACLE.COM; |
实体化视图已创建。
SQL> CREATE MATERIALIZED VIEW 2 YANGTK.T1 REFRESH FAST WITH PRIMARY KEY 3 AS SELECT * FROM YANGTK.T1@RAC1.US.ORACLE.COM; |
实体化视图已创建。
SQL> BEGIN 2 DBMS_REPCAT.CREATE_MVIEW_REPOBJECT(GNAME => 'REP_GROUP', SNAME => 'YANGTK', 3 ONAME => 'T', TYPE => 'SNAPSHOT', MIN_COMMUNICATION => TRUE); 4 END; 5 / |
PL/SQL 过程已成功完成。