OGG版本:V11.2.1.0.10
Oracle版本:V11.2.0.3
source:oracle 192.168.1.23 centos 6.2
target: oracle 192.168.1.24 centos 6.2
创建ogg子目录
[oracle@masicong ogg]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.10 17241368 OGGCORE_11.2.1.0.0OGGBP_PLATFORMS_130813.0048_FBO Linux, x64, 64bit (optimized), Oracle 11g on Aug 13 2013 06:04:43 Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved. GGSCI (masicong) 1> create subdirs Creating subdirectories under current directory /u01/app/oracle/ogg Parameter files /u01/app/oracle/ogg/dirprm: already exists Report files /u01/app/oracle/ogg/dirrpt: created Checkpoint files /u01/app/oracle/ogg/dirchk: created Process status files /u01/app/oracle/ogg/dirpcs: created SQL script files /u01/app/oracle/ogg/dirsql: created Database definitions files /u01/app/oracle/ogg/dirdef: created Extract data files /u01/app/oracle/ogg/dirdat: created Temporary files /u01/app/oracle/ogg/dirtmp: created GGSCI (masicong) 9> view a ERROR: Invalid command. GGSCI (masicong) 10> view params mgr PORT 7809 GGSCI (masicong) 11> start mgr Manager started. GGSCI (masicong) 12> info mgr Manager is running (IP port masicong.7809).
创建复制进程组
GGSCI (masicong) 5> view report einig1 2013-09-02 01:59:58 INFO OGG-01017 Wildcard resolution set to IMMEDIATE bec ause SOURCEISTABLE is used. *********************************************************************** Oracle GoldenGate Capture for Oracle Version 11.2.1.0.10 17241368 OGGCORE_11.2.1.0.0OGGBP_PLATFORMS_130813.0048_FBO Linux, x64, 64bit (optimized), Oracle 11g on Aug 13 2013 06:13:46 Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved. Starting at 2013-09-02 01:59:58 *********************************************************************** Operating System Version: Linux Version #1 SMP Fri Feb 22 00:31:26 UTC 2013, Release 2.6.32-358.el6.x86_64 Node: masicong 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: 2017 Description: *********************************************************************** ** Running with the following parameters ** *********************************************************************** 2013-09-02 01:59:58 INFO OGG-03035 Operating system character set identifie d as UTF-8. Locale: zh_CN, LC_ALL:. 2013-09-02 01:59:58 INFO OGG-02696 NON-ANSI SQL parameter syntax is used fo r parameter parsing. extract einig1 setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8) Set environment variable (NLS_LANG=AMERICAN_AMERICA.AL32UTF8) userid ogg,password *** 2013-09-02 01:59:58 INFO OGG-03500 WARNING: NLS_LANG environment variable d oes not match database character set, or not set. Using database character set v alue of ZHS16GBK. rmthost 192.168.1.24,mgrport 7809 rmttask replicat,group rinig1 table scott.t1; Using the following key columns for source table SCOTT.T1: OBJECT_ID. 2013-09-02 01:59:58 INFO OGG-01815 Virtual Memory Facilities for: COM anon alloc: mmap(MAP_ANON) anon free: munmap file alloc: mmap(MAP_SHARED) file free: munmap target directories: /u01/app/oracle/ogg/dirtmp. CACHEMGR virtual memory values (may have been adjusted) CACHESIZE: 64G CACHEPAGEOUTSIZE (normal): 8M PROCESS VM AVAIL FROM OS (min): 128G CACHESIZEMAX (strict force to disk): 96G Database Version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE 11.2.0.3.0 Production TNS for Linux: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production Database Language and Character Set: NLS_LANG = ".ZHS16GBK" NLS_LANGUAGE = "AMERICAN" NLS_TERRITORY = "AMERICA" NLS_CHARACTERSET = "ZHS16GBK"
source端设置
GGSCI (masicong) 19> dblogin userid ogg, password ogg Successfully logged into database. GGSCI (masicong) 20> add trandata scott.* 2013-09-02 02:08:01 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. Logging of supplemental redo data enabled for table SCOTT.BONUS. Logging of supplemental redo data enabled for table SCOTT.DEPT. Logging of supplemental redo data enabled for table SCOTT.EMP. 2013-09-02 02:08:01 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. Logging of supplemental redo data enabled for table SCOTT.SALGRADE. Logging of supplemental redo data enabled for table SCOTT.T1. GGSCI (masicong) 21> add extract eora_t1,tranlog,begin now EXTRACT added. GGSCI (masicong) 22> add exttrail ./dirdat/aa,extract eora_t1,megabytes 100 EXTTRAIL added. GGSCI (masicong) 23> start extract eora_t1 Sending START request to MANAGER ... EXTRACT EORA_T1 starting GGSCI (masicong) 24> info extract eora_t1 EXTRACT EORA_T1 Last Started 2013-09-02 02:09 Status RUNNING Checkpoint Lag 00:00:40 (updated 00:00:07 ago) Log Read Checkpoint Oracle Redo Logs 2013-09-02 02:08:26 Seqno 6, RBA 3204112 SCN 0.0 (0) GGSCI (masicong) 25> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING EORA_T1 00:00:00 00:00:07
target端设置
[oracle@masicong ogg]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.10 17241368 OGGCORE_11.2.1.0.0OGGBP_PLATFORMS_130813.0048_FBO Linux, x64, 64bit (optimized), Oracle 11g on Aug 13 2013 06:04:43 Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved. GGSCI (masicong) 1> dblogin userid ogg,password ogg Successfully logged into database. GGSCI (masicong) 2> add checkpointtable No checkpoint table specified, using GLOBALS specification (ogg.ggschkpt)... Successfully created checkpoint table ogg.ggschkpt. GGSCI (masicong) 3> select tname from tab; ERROR: Invalid command. GGSCI (masicong) 4> exit [oracle@masicong ogg]$ exit exit SQL> select tname from tab; TNAME ------------------------------ GGSCHKPT GGSCHKPT_LOX SQL> ! [oracle@masicong ogg]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.10 17241368 OGGCORE_11.2.1.0.0OGGBP_PLATFORMS_130813.0048_FBO Linux, x64, 64bit (optimized), Oracle 11g on Aug 13 2013 06:04:43 Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved. GGSCI (masicong) 1> edit params rora_t1 replicat rora_t1 setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8) userid ogg,password ogg handlecollisions assumetargetdefs discardfile ./dirrpt/rora_t1.dsc,purge map scott.* ,target scott.*;
官方文档查看:http://docs.oracle.com/cd/E35209_01/index.htm