OGG数据初始化配置

配置完Ogg mgr后,使用ogg的进程进行数据的初始化。但是操作之前还要使用两端的表结构要一致。

源端:

[oracle@db ogg]$ ./ggsci
GGSCI (db) 1> start mgr
Manager started.
GGSCI (db) 2> info mgr
Manager is running (IP port db.7809).
GGSCI (db) 3> add extract eini_1,sourceistable
GGSCI (db) 4> edit params eini_1
#输入以下内容:
-- GoldenGate Initial Data Capture
-- for TCUSTMER and TCUSTORD
EXTRACT EINI_1
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
USERID ogg, PASSWORD ogg
RMTHOST db1, MGRPORT 7809
RMTTASK REPLICAT, GROUP RINI_1
TABLE scott.*;
目标端:

[oracle@db1 ogg]$ ./ggsci
GGSCI (db1) 1> start mgr
Manager started.
GGSCI (db1) 2> info mgr
Manager is running (IP port db.7809).
GGSCI (db1) 3> add replicat rini_1,specialrun
GGSCI (db1) 4> edit params rini_1
输入以下内容:
-- GoldenGate Initial Load Delivery
REPLICAT RINI_1
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
ASSUMETARGETDEFS
USERID ogg, PASSWORD ogg
DISCARDFILE ./dirrpt/RINIaa.dsc, PURGE
MAP scott.*, TARGET scott.*;
配置完启动上述两个进程:

GGSCI (db) 5> start extract eini_1
	Sending START request to MANAGER ...
	EXTRACT EINI_1 starting
GGSCI (db1) 5> start extract rini_1
	Sending START request to MANAGER ...
	EXTRACT RINI_1 starting
查看报告:
源端:

GGSCI (db) 6> view report eini_1
	Report at 2014-12-10 11:23:35 (activity since 2014-12-10 11:23:28)
		Output to RINI_1:
	From Table SCOTT.EMP:
	       #                   inserts:         14
	       #                   updates:         0
	       #                   deletes:         0
	       #                  discards:         0
 目标端: 
  
GGSCI (db1) 3> view report rini_1
	Report at 2014-12-10 11:23:39 (activity since 2014-12-10 11:23:32)
	From Table SCOTT.EMP to SCOTT.TCUSTMER:
	       #                   inserts:         14
	       #                   updates:         0
	       #                   deletes:         0
	       #                  discards:         0
 
  

目标端查看数据加载:

[oracle@db1 ~]$ sqlplus / as sysdba
SQL> select * from scott.emp;
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 17-DEC-80        800                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
      7566 JONES      MANAGER         7839 02-APR-81       2975                    20
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
      7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
      7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
      7839 KING       PRESIDENT            17-NOV-81       5000                    10
      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
      7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
      7900 JAMES      CLERK           7698 03-DEC-81        950                    30
      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
      7934 MILLER     CLERK           7782 23-JAN-82       1300                    10

你可能感兴趣的:(Oracle,OGG)