首页 > 代码库 > GoldentGate Oracle to Oracle 初始化详解

GoldentGate Oracle to Oracle 初始化详解

一、安装GoldenGate[源端,目标端]

    1、创建ogg目录
    [root@source ~]# mkdir /DBSoft/ogg
    [root@source ~]# cd /DBSoft/ogg/

    2、解压缩ogg安装介质
    [root@source ogg]# unzip /root/OGG_v11_for_ora11g_linux64.zip
    Archive: /root/OGG_v11_for_ora11g_linux64.zip
      inflating: ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
      inflating: OGG_WinUnix_Rel_Notes_11.1.1.0.0_078.pdf
      inflating: README.txt

    3、可以看到介质包含一个tar包,pdf文件以及一个readme
    [root@source ogg]# ll
    total 201016
    -rw-rw---- 1 root root 205096960 Jul 29 2010 ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
    -rwxrwxr-x 1 root root 500964 Aug 6 2010 OGG_WinUnix_Rel_Notes_11.1.1.0.0_078.pdf
    -rwxrwxr-x 1 root root 26726 Aug 3 2010 README.txt

    4、修改ogg目录所属组为oinstall及所属用户为oracle
    [root@source ogg]# cd ..
    [root@source DBSoft]# ll
    total 32
    drwxr-x--- 3 oracle oinstall 4096 Sep 2 22:40 admin
    drwxr-xr-x 6 oracle oinstall 4096 Sep 2 22:44 cfgtoollogs
    drwxr-xr-x 3 oracle oinstall 4096 Sep 2 22:38 checkpoints
    drwxrwxr-x 11 oracle oinstall 4096 Sep 2 22:39 diag
    drwxr-x--- 4 oracle oinstall 4096 Sep 2 22:41 fast_recovery_area
    drwxr-xr-x 2 oracle oinstall 4096 Sep 3 10:27 ogg
    drwxrwx--- 5 oracle oinstall 4096 Sep 2 22:39 oraInventory
    drwxr-xr-x 3 oracle oinstall 4096 Sep 2 22:32 product

    [root@source DBSoft]# chown -R oracle:oinstall ogg/
    [root@source DBSoft]# su - oracle

    5、再次进入ogg目录,解压缩ogg主程序文件
    [oracle@source ~]$ cd /DBSoft/ogg/
    [oracle@source ogg]$ ll
    total 201016
    -rw-rw---- 1 oracle oinstall 205096960 Jul 29 2010 ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
    -rwxrwxr-x 1 oracle oinstall 500964 Aug 6 2010 OGG_WinUnix_Rel_Notes_11.1.1.0.0_078.pdf
    -rwxrwxr-x 1 oracle oinstall 26726 Aug 3 2010 README.txt

    #正在解压缩
    [oracle@source ogg]$ tar -xvf ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
    bcpfmt.tpl
    bcrypt.txt
    chkpt_ora_create.sql
    cobgen
    convchk
    db2cntl.tpl
    ddl_access.tpl
    ddl_cleartrace.sql
    ddlcob
    ddl_db2_os390.tpl
    ddl_db2.tpl
    ddl_ddl2file.sql
    ddl_disable.sql
    ddl_enable.sql
    ddlgen
    ddl_informix.tpl
    ddl_mss.tpl
    ddl_mysql.tpl
    ddl_nopurgeRecyclebin.sql
    ddl_nssql.tpl
    ddl_ora10.sql
    ddl_ora10upCommon.sql
    ddl_ora11.sql
    ddl_ora9.sql
    ddl_oracle.tpl
    ddl_pin.sql
    ddl_purgeRecyclebin.sql
    ddl_remove.sql
    ddl_session1.sql
    ddl_session.sql
    ddl_setup.sql
    ddl_sqlmx.tpl
    ddl_status.sql
    ddl_staymetadata_off.sql
    ddl_staymetadata_on.sql
    ddl_sybase.tpl
    ddl_tandem.tpl
    ddl_tracelevel.sql
    ddl_trace_off.sql
    ddl_trace_on.sql
    defgen
    demo_more_ora_create.sql
    demo_more_ora_insert.sql
    demo_ora_create.sql
    demo_ora_insert.sql
    demo_ora_lob_create.sql
    demo_ora_misc.sql
    demo_ora_pk_befores_create.sql
    demo_ora_pk_befores_insert.sql
    demo_ora_pk_befores_updates.sql
    emsclnt
    extract
    freeBSD.txt
    ggMessage.dat
    ggsci
    help.txt
    keygen
    libicudata.so.38
    libicui18n.so.38
    libicuuc.so.38
    libxerces-c.so.28
    libxml2.txt
    logdump
    marker_remove.sql
    marker_setup.sql
    marker_status.sql
    mgr
    notices.txt
    params.sql
    replicat
    reverse
    role_setup.sql
    server
    sqlldr.tpl
    tcperrs
    UserExitExamples/
    UserExitExamples/ExitDemo_lobs/
    UserExitExamples/ExitDemo_lobs/Makefile_lob.SOLARIS
    UserExitExamples/ExitDemo_lobs/readme.txt
    UserExitExamples/ExitDemo_lobs/exitdemo_lob.c
    UserExitExamples/ExitDemo_lobs/Makefile_lob.AIX
    UserExitExamples/ExitDemo_lobs/Makefile_lob.LINUX
    UserExitExamples/ExitDemo_lobs/Makefile_lob.HPUX
    UserExitExamples/ExitDemo_lobs/exitdemo_lob.vcproj
    UserExitExamples/ExitDemo_passthru/
    UserExitExamples/ExitDemo_passthru/Makefile_passthru.AIX
    UserExitExamples/ExitDemo_passthru/Makefile_passthru.LINUX
    UserExitExamples/ExitDemo_passthru/Makefile_passthru.SOLARIS
    UserExitExamples/ExitDemo_passthru/exitdemopassthru.vcproj
    UserExitExamples/ExitDemo_passthru/readme.txt
    UserExitExamples/ExitDemo_passthru/exitdemo_passthru.c
    UserExitExamples/ExitDemo_passthru/Makefile_passthru.HP_OSS
    UserExitExamples/ExitDemo_passthru/Makefile_passthru.HPUX
    UserExitExamples/ExitDemo_more_recs/
    UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.AIX
    UserExitExamples/ExitDemo_more_recs/readme.txt
    UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.vcproj
    UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.SOLARIS
    UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.LINUX
    UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.HPUX
    UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.c
    UserExitExamples/ExitDemo/
    UserExitExamples/ExitDemo/exitdemo.c
    UserExitExamples/ExitDemo/Makefile_exit_demo.HPUX
    UserExitExamples/ExitDemo/Makefile_exit_demo.SOLARIS
    UserExitExamples/ExitDemo/readme.txt
    UserExitExamples/ExitDemo/exitdemo.vcproj
    UserExitExamples/ExitDemo/Makefile_exit_demo.HP_OSS
    UserExitExamples/ExitDemo/Makefile_exit_demo.LINUX
    UserExitExamples/ExitDemo/Makefile_exit_demo.AIX
    UserExitExamples/ExitDemo_pk_befores/
    UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.vcproj
    UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.HPUX
    UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.AIX
    UserExitExamples/ExitDemo_pk_befores/readme.txt
    UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.c
    UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.LINUX
    UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.SOLARIS
    usrdecs.h
    zlib.txt

    6、解压缩完之后,执行ggsci命令进入OGG交互界面
    [oracle@source ogg]$GGSCI
    GGSCI (source) 1>

    7、创建OGG所需目录
    GGSCI (source) 1> create subdirs

    Creating subdirectories under current directory /DBSoft/ogg

    Parameter files /DBSoft/ogg/dirprm: created
    Report files /DBSoft/ogg/dirrpt: created
    Checkpoint files /DBSoft/ogg/dirchk: created
    Process status files /DBSoft/ogg/dirpcs: created
    SQL script files /DBSoft/ogg/dirsql: created
    Database definitions files /DBSoft/ogg/dirdef: created
    Extract data files /DBSoft/ogg/dirdat: created
    Temporary files /DBSoft/ogg/dirtmp: created
    Veridata files /DBSoft/ogg/dirver: created
    Veridata Lock files /DBSoft/ogg/dirver/lock: created
    Veridata Out-Of-Sync files /DBSoft/ogg/dirver/oos: created
    Veridata Out-Of-Sync XML files /DBSoft/ogg/dirver/oosxml: created
    Veridata Parameter files /DBSoft/ogg/dirver/params: created
    Veridata Report files /DBSoft/ogg/dirver/report: created
    Veridata Status files /DBSoft/ogg/dirver/status: created
    Veridata Trace files /DBSoft/ogg/dirver/trace: created
    Stdout files /DBSoft/ogg/dirout: created


    GGSCI (source) 2>exit

    8、至此我们可以看到目录已经创建,OGG安装初始化完成
    [oracle@source ogg]$ ls -ltr dir*
    dirver:
    total 28
    drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 trace
    drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 status
    drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 report
    drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 params
    drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 oosxml
    drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 oos
    drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 lock


二、源库配置OGG所需环境[源端,目标端]

    9、开启归档和附加信息到redo logfile
    SQL> alter database add supplemental log data; ----开启附加信息到redo logfile

    Database altered.

    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.

    SQL> startup mount;
    ORACLE instance started.

    Total System Global Area 2505338880 bytes
    Fixed Size 2255832 bytes
    Variable Size 620758056 bytes
    Database Buffers 1862270976 bytes
    Redo Buffers 20054016 bytes
    Database mounted.
    SQL> alter database archivelog;

    Database altered.

    SQL> alter database open;

    Database altered.


    SQL> alter system switch logfile;

    System altered.

    SQL> /

    System altered.

    SQL> select SUPPLEMENTAL_LOG_DATA_MIN from v$database;

    SUPPLEME
    --------
    YES


    10、创建OGG测试所需表空间及用户
    SQL> select tablespace_name,contents from dba_tablespaces;

    TABLESPACE_NAME CONTENTS
    ------------------------------ ---------
    SYSTEM PERMANENT
    SYSAUX PERMANENT
    UNDOTBS1 UNDO
    TEMP TEMPORARY
    USERS PERMANENT

    SQL> select file_name from dba_data_files;

    FILE_NAME
    --------------------------------------------------------------------------------
    /DBData/woo/users01.dbf
    /DBData/woo/undotbs01.dbf
    /DBData/woo/sysaux01.dbf
    /DBData/woo/system01.dbf

    SQL> create tablespace ggs datafile 

三、通过刚才创建的用户创建ogg所需的demo

    [oracle@source ogg]$ ll /DBSoft/ogg/demo*
    -r--r--r-- 1 oracle oinstall 1217 Mar 13 2010 /DBSoft/ogg/demo_more_ora_create.sql
    -r--r--r-- 1 oracle oinstall 967 Mar 13 2010 /DBSoft/ogg/demo_more_ora_insert.sql
    -r--r--r-- 1 oracle oinstall 883 Mar 13 2010 /DBSoft/ogg/demo_ora_create.sql
    -r--r--r-- 1 oracle oinstall 821 Mar 13 2010 /DBSoft/ogg/demo_ora_insert.sql
    -r--r--r-- 1 oracle oinstall 4015 Mar 13 2010 /DBSoft/ogg/demo_ora_lob_create.sql
    -r--r--r-- 1 oracle oinstall 2275 Mar 13 2010 /DBSoft/ogg/demo_ora_misc.sql
    -r--r--r-- 1 oracle oinstall 1269 Mar 13 2010 /DBSoft/ogg/demo_ora_pk_befores_create.sql
    -r--r--r-- 1 oracle oinstall 1227 Mar 13 2010 /DBSoft/ogg/demo_ora_pk_befores_insert.sql
    -r--r--r-- 1 oracle oinstall 2520 Mar 13 2010 /DBSoft/ogg/demo_ora_pk_befores_updates.sql

    SQL> @/DBSoft/ogg/demo_ora_create.sql

    Table created.

    Table created.


    SQL> @/DBSoft/ogg/demo_ora_insert.sql ###target端不需要执行

    1 row created.


    1 row created.


    1 row created.


    1 row created.


    Commit complete.

    11、在源端和目标端查询刚才创建的表
    SQL> col object_name format a15
    SQL> select object_name,object_type from user_objects;

    OBJECT_NAME OBJECT_TYPE
    --------------- -------------------
    SYS_C0011106 INDEX
    TCUSTMER TABLE
    TCUSTORD TABLE
    SYS_C0011107 INDEX

    SQL>

    12、仅在源端查询表中所插入的数据,目标端应为空表
    SQL> select * from tcustord;

    CUST ORDER_DAT PRODUCT_ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID
    ---- --------- -------- ---------- ------------- -------------- --------------
    WILL 30-SEP-94 CAR 144 17520 3 100
    JANE 11-NOV-95 PLANE 256 133300 1 100

    SQL> select * from tcustmer;

    CUST NAME CITY ST
    ---- ------------------------------ -------------------- --
    WILL BG SOFTWARE CO. SEATTLE WA
    JANE ROCKY FLYER INC. DENVER CO

    SQL>


###Prepare the Environment
###
四、配置ogg mgr进程

    13、配置mgr进程[源端,目标端]
    [oracle@source ogg]$ ggsci

    Oracle GoldenGate Command Interpreter for Oracle
    Version 11.1.1.0.0 Build 078
    Linux, x64, 64bit (optimized), Oracle 11 on Jul 28 2010 13:13:42

    Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.



    GGSCI (source) 1> edit params mgr ----添加如下两行内容

    --This is the minimal configuration of manager process
    PORT 7809


    ###通过系统命令查看刚才配置的,实际上将配置写入了一个文件

    [oracle@source ogg]$ cd dirprm/

    [oracle@source dirprm]$ pwd
    /DBSoft/ogg/dirprm

    [oracle@source dirprm]$ ls
    mgr.prm

    [oracle@source dirprm]$ cat mgr.prm
    --This is the minimal configuration of manager process
    PORT 7809


    14、启动mgr,及查看mgr状态[源端、目标端]
    GGSCI (source) 1> start mgr

    Manager started.


    GGSCI (source) 2> info mgr

    Manager is running (IP port source.7809).

    [oracle@source ogg]$ ps -ef|grep mgr
    oracle 6185 1 0 16:14 ? 00:00:00 ./mgr PARAMFILE /DBSoft/ogg/dirprm/mgr.prm REPORTFILE /DBSoft/ogg/dirrpt/MGR.rpt PROCESSID MGR PORT 7809


    15、查看mgr进程信息[源端、目标端]
    GGSCI (source) 3> view report mgr


    ***********************************************************************
                     Oracle GoldenGate Manager for Oracle
                         Version 11.1.1.0.0 Build 078
       Linux, x64, 64bit (optimized), Oracle 11 on Jul 28 2010 13:12:40
     
    Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.


                        Starting at 2014-09-03 16:14:10
    ***********************************************************************

    Operating System Version:
    Linux
    Version #1 SMP Fri Jan 27 17:17:51 EST 2012, Release 2.6.18-308.el5
    Node: source
    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: 6185

    Parameters...

    --This is the minimal configuration of manager process
    PORT 7809


    ***********************************************************************
    ** Run Time Messages **
    ***********************************************************************


    2014-09-03 16:14:10 INFO OGG-00983 Manager started (port 7809).


    16、在源端链接oracle数据库并配置需要同步的表
    GGSCI (source) 1> dblogin userid system, password oracle

    GGSCI (source) 3> add trandata ggs.tcustmer

    Successfully logged into database.

    Logging of supplemental redo data enabled for table GGS.TCUSTMER.

    GGSCI (source) 4> add trandata ggs.tcustord

    Logging of supplemental redo data enabled for table GGS.TCUSTORD.

    17、查看需要同步的表的信息
    GGSCI (source) 6> info trandata ggs.*

    Logging of supplemental redo log data is enabled for table GGS.TCUSTMER

    Logging of supplemental redo log data is enabled for table GGS.TCUSTORD


    ####initLoad


五、配置ogg extract进程

 18、源端配置extract抽取进程
GGSCI (source) 2> add extract einikk, SOURCEISTABLE
EXTRACT added.

GGSCI (source) 10> info extract *,tasks ----查看进程信息

EXTRACT EINIKK Initialized 2014-09-03 17:03 Status STOPPED
Checkpoint Lag Not Available
Log Read Checkpoint Not Available
                     First Record Record 0
Task SOURCEISTABLE

GGSCI (source) 3> edit params einik
--
-- GoldenGate Initial Data Capture
-- for TCUSTMER and TCUSTORD
--
EXTRACT EINIKK
USERID system , PASSWORD “oracle”
RMTHOST 192.168.7.21, MGRPORT 7809    ---远端的地址和端口
RMTTASK REPLICAT , GROUP RINIKK
TABLE ggs.TCUSTMER;
TABLE ggs.TCUSTORD;


19、目标端配置
GGSCI > add replicat rinikk,specialrun

GGSCI (source) 6> info replicat *,tasks

REPLICAT   RINIKK    Initialized   2014-09-03 23:21   Status STOPPED
Checkpoint Lag       00:00:00 (updated 12:04:39 ago)
Log Read Checkpoint  Not Available
Task                 SPECIALRUN

GGSCI 〉edit params rinikk        ---配置进程信息
-- This is replicate parameter file
REPLICAT RINIKK
ASSUMETARGETDEFS
USERID system, PASSWORD oracle
DISCARDFILE ./dirrpt/RINIKK.dsc, PURGE
MAP ggs.*, TARGET ggs.*;



20、查看两个节点的mgr是否启动,并启动源端的extract进程

GGSCI (source) 18> info mgr

Manager is running (IP port source.7809).


GGSCI (source) 16> start extract einikk

Sending START request to MANAGER ...
EXTRACT EINIKK starting

21、查看源端extrace进程详细信息
GGSCI (source) 38> view report einikk


2014-09-04 14:06:13  INFO    OGG-01017  Wildcard resolution set to IMMEDIATE because SOURCEISTABLE is used.

***********************************************************************
                 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-09-04 14:06:13
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Fri Jan 27 17:17:51 EST 2012, Release 2.6.18-308.el5
Node: source
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: 3803

Description:

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
EXTRACT EINIKK
USERID system , PASSWORD "******"
RMTHOST 192.168.7.21 , MGRPORT 7809
RMTTASK REPLICAT , GROUP RINIKK
TABLE ggs.TCUSTMER;

Using the following key columns for source table GGS.TCUSTMER: CUST_CODE.
TABLE ggs.TCUSTORD;

Using the following key columns for source table GGS.TCUSTORD: CUST_CODE, ORDER_DATE, PRODUCT_CODE, ORDER_ID.

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 environment variable specified has invalid format, default value will be used.
NLS_LANG environment variable not set, using default value AMERICAN_AMERICA.US7ASCII.
NLS_LANGUAGE     = "AMERICAN"
NLS_TERRITORY    = "AMERICA"
NLS_CHARACTERSET = "AL32UTF8"

Warning: your NLS_LANG setting does not match database server language setting.
Please refer to user manual for more information.

Processing table GGS.TCUSTMER

Processing table GGS.TCUSTORD

***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************


Report at 2014-09-04 14:06:21 (activity since 2014-09-04 14:06:13)

Output to RINIKK:

From Table GGS.TCUSTMER:
       #                   inserts:         2
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0
From Table GGS.TCUSTORD:
       #                   inserts:         2
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0




22、查看目标端extrace信息
GGSCI (target) 6> view report rinikk


***********************************************************************
                 Oracle GoldenGate Delivery for Oracle
                     Version 11.1.1.0.0 Build 078
   Linux, x64, 64bit (optimized), Oracle 11 on Jul 28 2010 15:35:17
 
Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.


                    Starting at 2014-09-04 14:06:13
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Fri Jan 27 17:17:51 EST 2012, Release 2.6.18-308.el5
Node: target
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: 3888

Description:

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************
-- This is replicate parameter file
REPLICAT RINIKK
ASSUMETARGETDEFS
USERID system , PASSWORD ******
DISCARDFILE ./dirrpm/RINIKK.dsc , PURGE
MAP ggs.* , TARGET ggs.*;

CACHEMGR virtual memory values (may have been adjusted)
CACHEBUFFERSIZE:                         64K
CACHESIZE:                              512M
CACHEBUFFERSIZE (soft max):               4M
CACHEPAGEOUTSIZE (normal):                4M
PROCESS VM AVAIL FROM OS (min):           1G
CACHESIZEMAX (strict force to disk):    881M

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 environment variable specified has invalid format, default value will be used.
NLS_LANG environment variable not set, using default value AMERICAN_AMERICA.US7ASCII.
NLS_LANGUAGE     = "AMERICAN"
NLS_TERRITORY    = "AMERICA"
NLS_CHARACTERSET = "AL32UTF8"

Warning: your NLS_LANG setting does not match database server language setting.
Please refer to user manual for more information.

***********************************************************************
**                     Run Time Messages                             **
***********************************************************************


Wildcard MAP resolved (entry GGS.*):
  MAP GGS.TCUSTMER, TARGET ggs.TCUSTMER;
Using following columns in default map by name:
  CUST_CODE, NAME, CITY, STATE

Using the following key columns for target table GGS.TCUSTMER: CUST_CODE.


Wildcard MAP resolved (entry GGS.*):
  MAP GGS.TCUSTORD, TARGET ggs.TCUSTORD;
Using following columns in default map by name:
  CUST_CODE, ORDER_DATE, PRODUCT_CODE, ORDER_ID, PRODUCT_PRICE,
  PRODUCT_AMOUNT, TRANSACTION_ID

Using the following key columns for target table GGS.TCUSTORD: CUST_CODE, ORDER_DATE, PRODUCT_CODE, ORDER_ID.


***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************


Report at 2014-09-04 14:06:26 (activity since 2014-09-04 14:06:19)

From Table GGS.TCUSTMER to GGS.TCUSTMER:
       #                   inserts:         2
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0
From Table GGS.TCUSTORD to GGS.TCUSTORD:
       #                   inserts:         2
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0


CACHE OBJECT MANAGER statistics

CACHE MANAGER VM USAGE
vm current     =      0    vm anon queues =      0
vm anon in use =      0    vm file        =      0
vm used max    =      0    ==> CACHE BALANCED

CACHE CONFIGURATION
cache size       = 512M   cache force paging = 881M
buffer min       =  64K   buffer highwater   =   4M
pageout eligible size =   4M

CACHE Transaction Stats
trans active   =      0    max concurrent =      0
non-zero total =      0    trans total    =      0

CACHE File Caching
disk current   =      0    disk total  =      0
disk caching   =      0    file cached =      0
file retrieves =      0

CACHE MANAGEMENT
buffer links  =      0   anon gets   =      0
forced unmaps =      0   cnnbl try   =      0
cached out    =      0   force out   =      0

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0

Cached Transaction Size Distribution
    0:        0
 < 4K:        0
   4K:        0         0     |  16K:        0         0
  64K:        0         0     | 256K:        0         0
   1M:        0         0     |   4M:        0         0
  16M:        0         0     |  64M:        0         0
 256M:        0         0     |   1G:        0         0
   4G:        0         0     |  16G:        0         0
  64G:        0         0     | 256G:        0         0
   1T:        0         0     |   4T:        0         0
  16T:        0         0     |  64T:        0         0
 256T:        0         0     |1024T:        0         0


QUEUE Statistics:
num queues    =     15     default index =      0
cur len       =      0     max len       =      0
q vm current  =      0     vm max        =      0
q hits        =      0     q misses      =      0

queue size  q hits  curlen  maxlen     cannibalized
  0   64K      0       0       0       0
  1  128K      0       0       0       0
  2  256K      0       0       0       0
  3  512K      0       0       0       0
  4    1M      0       0       0       0
  5    2M      0       0       0       0
  6    4M      0       0       0       0
  7    8M      0       0       0       0
  8   16M      0       0       0       0
  9   32M      0       0       0       0
 10   64M      0       0       0       0
 11  128M      0       0       0       0
 12  256M      0       0       0       0
 13  512M      0       0       0       0
 14    1G      0       0       0       0

================================================================================
CACHE POOL #0
POOL INFO   group: rinikk  id: p3888_BLOB
trans active  =       0   trans concurrent (max) =     0
trans total   =       0   (0 )
flag          = 0x00000000
last error    = (0=<none>)

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0


QUEUE Statistics:
num queues    =     15     default index =      0
cur len       =      0     max len       =      0
q vm current  =      0     vm max        =      0
q hits        =      0     q misses      =      0

queue size  q hits  curlen  maxlen     cannibalized
  0   64K      0       0       0       0
  1  128K      0       0       0       0
  2  256K      0       0       0       0
  3  512K      0       0       0       0
  4    1M      0       0       0       0
  5    2M      0       0       0       0
  6    4M      0       0       0       0
  7    8M      0       0       0       0
  8   16M      0       0       0       0
  9   32M      0       0       0       0
 10   64M      0       0       0       0
 11  128M      0       0       0       0
 12  256M      0       0       0       0
 13  512M      0       0       0       0
 14    1G      0       0       0       0

================================================================================
CACHE POOL #0
POOL INFO   group: rinikk  id: p3888_BLOB
trans active  =       0   trans concurrent (max) =     0
trans total   =       0   (0 )
flag          = 0x00000000
last error    = (0=<none>)

Allocation Request Distribution
< 128B:       0
 128B:        0         0     | 512B:        0         0
   2K:        0         0     |   8K:        0         0
  32K:        0         0     | 128K:        0         0
 512K:        0         0     |   2M:        0         0
   8M:        0         0     |  32M:        0         0
 128M:        0         0     | 512M:        0         0
   2G:        0         0     |   8G:        0 

六、验证初始化是否成功

    23、在目标端查看表信息是否进来了,我们可以看到表数据已经传输过来了。
    SQL> select * from tcustmer;

    CUST NAME CITY ST
    ---- ------------------------------ -------------------- --
    WILL BG SOFTWARE CO. SEATTLE WA
    JANE ROCKY FLYER INC. DENVER CO

    SQL> select * from tcustord;

    CUST ORDER_DAT PRODUCT_ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID
    ---- --------- -------- ---------- ------------- -------------- --------------
    WILL 30-SEP-94 CAR 144 17520 3 100
    JANE 11-NOV-95 PLANE 256 133300 1 100


七、配置实时同步

    24、在源端添加抓取进程
    GGSCI (source) 39> add extract eorakk, tranlog, begin now, threads 1
    EXTRACT added.


    GGSCI (source) 40> info extract * --查看抓取进程信息

    EXTRACT EORAKK Initialized 2014-09-04 14:26 Status STOPPED
    Checkpoint Lag 00:00:00 (updated 00:00:06 ago)
    Log Read Checkpoint Oracle Redo Logs
                         2014-09-04 14:26:51 Thread 1, Seqno 0, RBA 0

    GGSCI (source) 41> edit params eorakk ---编辑抓取进程参数
    EXTRACT EORAKK
    USERID system, PASSWORD oracle
    RMTHOST 192.168.7.21, MGRPORT 7809
    RMTTRAIL ./dirdat/kk
    TABLE ggs.TCUSTMER;
    TABLE ggs.TCUSTORD;

    GGSCI (source) 42> ADD RMTTRAIL ./dirdat/kk, EXTRACT EORAKK, MEGABYTES 5 ---添加TRAIL
    RMTTRAIL added.

    GGSCI (source) 43> info rmttrail *

           Extract Trail: ./dirdat/kk
                 Extract: EORAKK
                   Seqno: 0
                     RBA: 0
               File Size: 5M

    GGSCI (source) 44> start extract eorakk ---启动TRAIL

    Sending START request to MANAGER ...
    EXTRACT EORAKK starting


    GGSCI (source) 45> info all

    Program Status Group Lag Time Since Chkpt

    MANAGER RUNNING
    EXTRACT RUNNING EORAKK 00:00:00 00:08:57


    GGSCI (source) 46> info extract eorakk, detail

    EXTRACT EORAKK Last Started 2014-09-04 14:35 Status RUNNING
    Checkpoint Lag 00:00:00 (updated 00:00:09 ago)
    Log Read Checkpoint Oracle Redo Logs
                         2014-09-04 14:35:50 Thread 1, Seqno 23, RBA 10829824

      Target Extract Trails:

      Remote Trail Name Seqno RBA Max MB

      ./dirdat/kk 0 921 5

      Extract Source Begin End

      /DBData/woo/redo02.log 2014-09-04 14:26 2014-09-04 14:35
      Not Available * Initialized * 2014-09-04 14:26


    Current directory /DBSoft/ogg

    Report file /DBSoft/ogg/dirrpt/EORAKK.rpt
    Parameter file /DBSoft/ogg/dirprm/eorakk.prm
    Checkpoint file /DBSoft/ogg/dirchk/EORAKK.cpe
    Process file /DBSoft/ogg/dirpcs/EORAKK.pce
    Stdout file /DBSoft/ogg/dirout/EORAKK.out
    Error log /DBSoft/ogg/ggserr.log


    GGSCI (source) 47> view report eorakk


    ***********************************************************************
                     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-09-04 14:35:44
    ***********************************************************************

    Operating System Version:
    Linux
    Version #1 SMP Fri Jan 27 17:17:51 EST 2012, Release 2.6.18-308.el5
    Node: source
    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: 3961

    Description:

    ***********************************************************************
    ** Running with the following parameters **
    ***********************************************************************
    --
    -- Change Capture parameter file to capture
    -- TCUSTMER and TCUSTORD Changes
    --
    EXTRACT EORAKK
    USERID system, PASSWORD ******
    RMTHOST 192.168.7.21, MGRPORT 7809
    RMTTRAIL ./dirdat/kk
    TABLE ggs.TCUSTMER;
    TABLE ggs.TCUSTORD;

    2014-09-04 14:35:44 INFO OGG-01635 BOUNDED RECOVERY: reset to initial or altered checkpoint.

    Bounded Recovery Parameter:
    Options = BRRESET
    BRINTERVAL = 4HOURS
    BRDIR = /DBSoft/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 environment variable specified has invalid format, default value will be used.
    NLS_LANG environment variable not set, using default value AMERICAN_AMERICA.US7ASCII.
    NLS_LANGUAGE = 


GoldentGate Oracle to Oracle 初始化详解