--配置启动extract、pump、rmttrail
GGSCI (vzwc1) 1> dblogin userid ggadmin, password ggadmin
Successfully logged into database.
GGSCI (vzwc1) 7> add extract sora, tranlog, threads 2, begin now
EXTRACT added.
GGSCI (vzwc1) 8> ADD EXTTRAIL ./dirdat/ea, EXTRACT SORA
EXTTRAIL added.
GGSCI (vzwc1) 9> edit params sora
GGSCI (vzwc1) 10> view params SORA
EXTRACT SORA
USERID GGADMIN, PASSWORD ggadmin
EXTTRAIL ./dirdat/ea
TRANLOGOPTIONS RAWDEVICEOFFSET 0
REPORTCOUNT EVERY 1 MINUTES, RATE
DISCARDFILE ./dirrpt/exta.dsc,APPEND,MEGABYTES 1024
FETCHOPTIONS NOUSESNAPSHOT
ThreadOptions MaxCommitPropagationDelay 10000 IOLatency 3000
TRANLOGOPTIONS _INFINITYTOZERO
TRANLOGOPTIONS ASMUSER sys@asm , ASMPASSWORD Oracle
DYNAMICRESOLUTION
TABLE SCOTT.*;
GGSCI (vzwc1) 102> add extract pora, exttrailsource ./dirdat/ea
EXTRACT added.
GGSCI (vzwc1) 103> add rmttrail ./dirdat/eb, extract pora, megabytes 20
RMTTRAIL added.
GGSCI (vzwc1) 105> view params pora
extract pora
userid ggadmin, password ggadmin
rmthost 192.168.1.23, mgrport 7809
rmttrail ./dirdat/eb
PASSTHRU
table SCOTT.*;
--查看进程状态
GGSCI (vzwc1) 137> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING PORA 00:00:00 00:00:09
EXTRACT RUNNING SORA 00:00:01 00:00:02
GGSCI (vzwc1) 139> info sora
EXTRACT SORA Last Started 2014-02-15 23:36 Status RUNNING
Checkpoint Lag 00:00:01 (updated 00:00:05 ago)
Log Read Checkpoint Oracle Redo Logs
2014-02-15 23:37:46 Thread 1, Seqno 67, RBA 640016
Log Read Checkpoint Oracle Redo Logs
2014-02-15 23:37:47 Thread 2, Seqno 64, RBA 30771728
GGSCI (vzwc1) 140> info pora
EXTRACT PORA Last Started 2014-02-15 23:33 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:05 ago)
Log Read Checkpoint File ./dirdat/ea000000
First Record RBA 923
GGSCI (vzwc1) 141> view report sora
***********************************************************************
Oracle GoldenGate Capture for Oracle
Version 11.1.1.0.0 Build 078
Linux, x64, 64bit (optimized), Oracle 11 on Jul 28 2010 14:58:37
Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
Starting at 2014-02-15 23:36:06
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Feb 22 17:37:40 EST 2012, Release 2.6.32-300.10.1.el5uek
Node: vzwc1
Machine: x86_64
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 20667
Description:
***********************************************************************
** Running with the following parameters **
***********************************************************************
EXTRACT SORA
USERID GGADMIN, PASSWORD *******
EXTTRAIL ./dirdat/ea
TRANLOGOPTIONS RAWDEVICEOFFSET 0
REPORTCOUNT EVERY 1 MINUTES, RATE
DISCARDFILE ./dirrpt/exta.dsc,APPEND,MEGABYTES 1024
FETCHOPTIONS NOUSESNAPSHOT
ThreadOptions MaxCommitPropagationDelay 10000 IOLatency 3000
TRANLOGOPTIONS _INFINITYTOZERO
TRANLOGOPTIONS ASMUSER sys@asm , ASMPASSWORD ******
DYNAMICRESOLUTION
TABLE SCOTT.*;
2014-02-15 23:36:06 INFO OGG-01635 BOUNDED RECOVERY: reset to initial or altered checkpoint.
Bounded Recovery Parameter:
Options = BRRESET
BRINTERVAL = 4HOURS
BRDIR = /ggs/ogg
CACHEMGR virtual memory values (may have been adjusted)
CACHEBUFFERSIZE: 64K
CACHESIZE: 8G
CACHEBUFFERSIZE (soft max): 4M
CACHEPAGEOUTSIZE (normal): 4M
PROCESS VM AVAIL FROM OS (min): 16G
CACHESIZEMAX (strict force to disk): 13.99G
Database Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
Database Language and Character Set:
NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK"
NLS_LANGUAGE = "AMERICAN"
NLS_TERRITORY = "AMERICA"
NLS_CHARACTERSET = "ZHS16GBK"
Maximum supported ASM read buffer size is 28 KB
Maximum supported ASM read buffer size is 28 KB
2014-02-15 23:36:07 INFO OGG-00546 Default thread stack size: 8388608.
2014-02-15 23:36:07 INFO OGG-01513 Positioning to (Thread 1) Sequence 67, RBA 183312, SCN 0.0.
2014-02-15 23:36:08 INFO OGG-01516 Positioned to (Thread 1) Sequence 67, RBA 183312, SCN 0.0, Feb 15, 2014 11:24:46 PM.
2014-02-15 23:36:08 INFO OGG-01513 Positioning to (Thread 2) Sequence 64, RBA 30332944, SCN 0.0.
2014-02-15 23:36:08 INFO OGG-01516 Positioned to (Thread 2) Sequence 64, RBA 30332944, SCN 0.0, Feb 15, 2014 11:24:46 PM.
2014-02-15 23:36:08 INFO OGG-01052 No recovery is required for target file ./dirdat/ea000000, at RBA 0 (file not opened).
2014-02-15 23:36:08 INFO OGG-01478 Output file ./dirdat/ea is using format RELEASE 10.4/11.1.
2014-02-15 23:36:08 INFO OGG-01517 Position of first record processed for Thread 1, Sequence 67, RBA 183312, SCN 0.2360215, Feb 15, 2014 11:24:46 PM.
***********************************************************************
** Run Time Messages **
***********************************************************************
2014-02-15 23:36:08 INFO OGG-01517 Position of first record processed for Thread 2, Sequence 64, RBA 30332944, SCN 0.2360215, Feb 15, 2014 11:24:46 PM.
--生成defgen文件,并且拷贝到目标段/ggs/ogg/dirdef下
GGSCI (vzwc1) 144> edit param defgen
GGSCI (vzwc1) 145> view param defgen
DEFSFILE ./dirdef/scott.def
USERID GGADMIN, PASSWORD ggadmin
table SCOTT.*;
[oracle@vzwc1 ogg]$ ./defgen paramfile ./dirprm/defgen.prm
***********************************************************************
Oracle GoldenGate Table Definition Generator for Oracle
Version 11.1.1.0.0 Build 078
Linux, x64, 64bit (optimized), Oracle 11 on Jul 28 2010 13:15:49
Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
Starting at 2014-02-15 23:45:43
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Feb 22 17:37:40 EST 2012, Release 2.6.32-300.10.1.el5uek
Node: vzwc1
Machine: x86_64
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 21351
***********************************************************************
** Running with the following parameters **
***********************************************************************
DEFSFILE ./dirdef/scott.def
USERID GGADMIN, PASSWORD *******
table SCOTT.*;
Expanding wildcard SCOTT.*:
Retrieving definition for SCOTT.BONUS
2014-02-15 23:45:44 WARNING OGG-00869 No unique key is defined for table BONUS. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Retrieving definition for SCOTT.DEPT
Retrieving definition for SCOTT.EMP
Retrieving definition for SCOTT.SALGRADE
2014-02-15 23:45:44 WARNING OGG-00869 No unique key is defined for table SALGRADE. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
Definitions generated for 4 tables in ./dirdef/scott.def
[oracle@vzwc1 ogg]$ scp dirdef/scott.def gpadmin@192.168.1.23:/ggs/ogg/dirdef
The authenticity of host '192.168.1.23 (192.168.1.23)' can't be established.
RSA key fingerprint is c6:be:66:22:c8:96:ee:28:5c:9c:fe:f3:89:4e:07:e0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.23' (RSA) to the list of known hosts.
gpadmin@192.168.1.23's password:
scott.def 100% 2329 2.3KB/s 00:00
[oracle@vzwc1 ogg]$
==================================================================
目标段配置FaltFileWriter extract
--目标段的OGG需要安装在GreenPlum的Master节点上,这里软件版本、路径和源端一致,你可能需要拷贝源端oracle的lib库来运行ggsci等程序
--创建File
GGSCI (mdw) 13> add extract ffwriter, exttrailsource ./dirdat/eb
EXTRACT added.
GGSCI (mdw) 7> view param ffwriter
extract ffwriter
CUSEREXIT ./flatfilewriter.so CUSEREXIT PASSTHRU INCLUDEUPDATEBEFORES, PARAMS "ffwriter.properties"
sourcedefs ./dirdef/scott.def
table SCOTT.*;