使用GoldenGate 实现Oracle for Oracle 单向数据同步(2)

Processing table SCOTT.TCUSTMER
 
Processing table SCOTT.TCUSTORD
 
***********************************************************************
*                  ** Run Time Statistics **                        *
***********************************************************************
 
 
Report at 2015-09-11 16:23:40 (activity since 2015-09-11 16:23:33)
 
Output to RINILOAD:
 
From Table SCOTT.TCUSTMER:
      #                  inserts:        2
      #                  updates:        0
      #                  deletes:        0
      #                  discards:        0
From Table SCOTT.TCUSTORD:
      #                  inserts:        2
      #                  updates:        0
      #                  deletes:        0
      #                  discards:        0
 
 
REDO Log Statistics
  Bytes parsed                    0
  Bytes output                  574

日志显示,已成功同步数据。

到目的库上验证

SQL> select count(*) from tcustmer;
 
  COUNT(*)
----------
    2
 
SQL> select count(*) from tcustord;
 
  COUNT(*)
----------
    2

二、配置数据实时同步

源端,配置一个实时Extract

GGSCI (localhost.localdomain) 22> ADD EXTRACT EORAKK, TRANLOG, BEGIN NOW, THREADS 1
EXTRACT added.

编辑Extract的参数文件

GGSCI (localhost.localdomain) 23> EDIT PARAMS EORAKK
 
 
--
-- Change Capture parameter file to capture
-- TCUSTMER and TCUSTORD Changes
--
EXTRACT EORAKK
USERID system, PASSWORD oracle
RMTHOST 192.168.199.104, MGRPORT 7809
RMTTRAIL ./dirdat/KK
TABLE SCOTT.TCUSTMER;
TABLE SCOTT.TCUSTORD;

为Extract添加远端tail file,也就是说这个tail file是在目的端生成的。

GGSCI (localhost.localdomain) 24> ADD RMTTRAIL ./dirdat/KK, EXTRACT EORAKK, MEGABYTES 5
RMTTRAIL added.

验证结果

GGSCI (localhost.localdomain) 28> INFO RMTTRAIL *
 
      Extract Trail: ./dirdat/KK
            Extract: EORAKK
              Seqno: 0
                RBA: 0
          File Size: 5M

启动Extract 进程

GGSCI (localhost.localdomain) 29> start extract eorakk
 
Sending START request to MANAGER ...
EXTRACT EORAKK starting

验证结果

GGSCI (localhost.localdomain) 30> INFO EXTRACT EORAKK, DETAIL
 
EXTRACT    EORAKK    Last Started 2015-09-11 17:07  Status RUNNING
Checkpoint Lag      00:00:00 (updated 00:00:01 ago)
Log Read Checkpoint  Oracle Redo Logs
                    2015-09-11 17:07:47  Thread 1, Seqno 25, RBA 36139008
                    SCN 0.1174781 (1174781)
 
  Target Extract Trails:
 
  Remote Trail Name                                Seqno        RBA    Max MB
 
  ./dirdat/KK                                          0      1050          5
 
  Extract Source                          Begin            End           
 
  /u01/app/oracle/oradata/orcl/redo01.log  2015-09-11 16:58  2015-09-11 17:07
  Not Available                          * Initialized *  2015-09-11 16:58
 
 
Current directory    /u01/app/ogg
 
Report file          /u01/app/ogg/dirrpt/EORAKK.rpt
Parameter file      /u01/app/ogg/dirprm/eorakk.prm
Checkpoint file      /u01/app/ogg/dirchk/EORAKK.cpe
Process file        /u01/app/ogg/dirpcs/EORAKK.pce
Stdout file          /u01/app/ogg/dirout/EORAKK.out
Error log            /u01/app/ogg/ggserr.log

GGSCI (localhost.localdomain) 31> VIEW REPORT EORAKK

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/691dce232d553094db55b1e93106d7fd.html