GoldentGate Oracle to Oracle 初始化詳解

dbhelper發表於2014-12-03
一、安裝GoldenGate[源端,目標端]
  1. 1、建立ogg目錄
  2. [root@source ~]# mkdir /DBSoft/ogg
  3. [root@source ~]# cd /DBSoft/ogg/

  4. 2、解壓縮ogg安裝介質
  5. [root@source ogg]# unzip /root/OGG_v11_for_ora11g_linux64.zip
  6. Archive: /root/OGG_v11_for_ora11g_linux64.zip
  7.   inflating: ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
  8.   inflating: OGG_WinUnix_Rel_Notes_11.1.1.0.0_078.pdf
  9.   inflating: README.txt

  10. 3、可以看到介質包含一個tar包,pdf檔案以及一個readme
  11. [root@source ogg]# ll
  12. total 201016
  13. -rw-rw---- 1 root root 205096960 Jul 29 2010 ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
  14. -rwxrwxr-x 1 root root 500964 Aug 6 2010 OGG_WinUnix_Rel_Notes_11.1.1.0.0_078.pdf
  15. -rwxrwxr-x 1 root root 26726 Aug 3 2010 README.txt

  16. 4、修改ogg目錄所屬組為oinstall及所屬使用者為oracle
  17. [root@source ogg]# cd ..
  18. [root@source DBSoft]# ll
  19. total 32
  20. drwxr-x--- 3 oracle oinstall 4096 Sep 2 22:40 admin
  21. drwxr-xr-x 6 oracle oinstall 4096 Sep 2 22:44 cfgtoollogs
  22. drwxr-xr-x 3 oracle oinstall 4096 Sep 2 22:38 checkpoints
  23. drwxrwxr-x 11 oracle oinstall 4096 Sep 2 22:39 diag
  24. drwxr-x--- 4 oracle oinstall 4096 Sep 2 22:41 fast_recovery_area
  25. drwxr-xr-x 2 oracle oinstall 4096 Sep 3 10:27 ogg
  26. drwxrwx--- 5 oracle oinstall 4096 Sep 2 22:39 oraInventory
  27. drwxr-xr-x 3 oracle oinstall 4096 Sep 2 22:32 product

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

  30. 5、再次進入ogg目錄,解壓縮ogg主程式檔案
  31. [oracle@source ~]$ cd /DBSoft/ogg/
  32. [oracle@source ogg]$ ll
  33. total 201016
  34. -rw-rw---- 1 oracle oinstall 205096960 Jul 29 2010 ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
  35. -rwxrwxr-x 1 oracle oinstall 500964 Aug 6 2010 OGG_WinUnix_Rel_Notes_11.1.1.0.0_078.pdf
  36. -rwxrwxr-x 1 oracle oinstall 26726 Aug 3 2010 README.txt

  37. #正在解壓縮
  38. [oracle@source ogg]$ tar -xvf ggs_Linux_x64_ora11g_64bit_v11_1_1_0_0_078.tar
  39. bcpfmt.tpl
  40. bcrypt.txt
  41. chkpt_ora_create.sql
  42. cobgen
  43. convchk
  44. db2cntl.tpl
  45. ddl_access.tpl
  46. ddl_cleartrace.sql
  47. ddlcob
  48. ddl_db2_os390.tpl
  49. ddl_db2.tpl
  50. ddl_ddl2file.sql
  51. ddl_disable.sql
  52. ddl_enable.sql
  53. ddlgen
  54. ddl_informix.tpl
  55. ddl_mss.tpl
  56. ddl_mysql.tpl
  57. ddl_nopurgeRecyclebin.sql
  58. ddl_nssql.tpl
  59. ddl_ora10.sql
  60. ddl_ora10upCommon.sql
  61. ddl_ora11.sql
  62. ddl_ora9.sql
  63. ddl_oracle.tpl
  64. ddl_pin.sql
  65. ddl_purgeRecyclebin.sql
  66. ddl_remove.sql
  67. ddl_session1.sql
  68. ddl_session.sql
  69. ddl_setup.sql
  70. ddl_sqlmx.tpl
  71. ddl_status.sql
  72. ddl_staymetadata_off.sql
  73. ddl_staymetadata_on.sql
  74. ddl_sybase.tpl
  75. ddl_tandem.tpl
  76. ddl_tracelevel.sql
  77. ddl_trace_off.sql
  78. ddl_trace_on.sql
  79. defgen
  80. demo_more_ora_create.sql
  81. demo_more_ora_insert.sql
  82. demo_ora_create.sql
  83. demo_ora_insert.sql
  84. demo_ora_lob_create.sql
  85. demo_ora_misc.sql
  86. demo_ora_pk_befores_create.sql
  87. demo_ora_pk_befores_insert.sql
  88. demo_ora_pk_befores_updates.sql
  89. emsclnt
  90. extract
  91. freeBSD.txt
  92. ggMessage.dat
  93. ggsci
  94. help.txt
  95. keygen
  96. libicudata.so.38
  97. libicui18n.so.38
  98. libicuuc.so.38
  99. libxerces-c.so.28
  100. libxml2.txt
  101. logdump
  102. marker_remove.sql
  103. marker_setup.sql
  104. marker_status.sql
  105. mgr
  106. notices.txt
  107. params.sql
  108. replicat
  109. reverse
  110. role_setup.sql
  111. server
  112. sqlldr.tpl
  113. tcperrs
  114. UserExitExamples/
  115. UserExitExamples/ExitDemo_lobs/
  116. UserExitExamples/ExitDemo_lobs/Makefile_lob.SOLARIS
  117. UserExitExamples/ExitDemo_lobs/readme.txt
  118. UserExitExamples/ExitDemo_lobs/exitdemo_lob.c
  119. UserExitExamples/ExitDemo_lobs/Makefile_lob.AIX
  120. UserExitExamples/ExitDemo_lobs/Makefile_lob.LINUX
  121. UserExitExamples/ExitDemo_lobs/Makefile_lob.HPUX
  122. UserExitExamples/ExitDemo_lobs/exitdemo_lob.vcproj
  123. UserExitExamples/ExitDemo_passthru/
  124. UserExitExamples/ExitDemo_passthru/Makefile_passthru.AIX
  125. UserExitExamples/ExitDemo_passthru/Makefile_passthru.LINUX
  126. UserExitExamples/ExitDemo_passthru/Makefile_passthru.SOLARIS
  127. UserExitExamples/ExitDemo_passthru/exitdemopassthru.vcproj
  128. UserExitExamples/ExitDemo_passthru/readme.txt
  129. UserExitExamples/ExitDemo_passthru/exitdemo_passthru.c
  130. UserExitExamples/ExitDemo_passthru/Makefile_passthru.HP_OSS
  131. UserExitExamples/ExitDemo_passthru/Makefile_passthru.HPUX
  132. UserExitExamples/ExitDemo_more_recs/
  133. UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.AIX
  134. UserExitExamples/ExitDemo_more_recs/readme.txt
  135. UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.vcproj
  136. UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.SOLARIS
  137. UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.LINUX
  138. UserExitExamples/ExitDemo_more_recs/Makefile_more_recs.HPUX
  139. UserExitExamples/ExitDemo_more_recs/exitdemo_more_recs.c
  140. UserExitExamples/ExitDemo/
  141. UserExitExamples/ExitDemo/exitdemo.c
  142. UserExitExamples/ExitDemo/Makefile_exit_demo.HPUX
  143. UserExitExamples/ExitDemo/Makefile_exit_demo.SOLARIS
  144. UserExitExamples/ExitDemo/readme.txt
  145. UserExitExamples/ExitDemo/exitdemo.vcproj
  146. UserExitExamples/ExitDemo/Makefile_exit_demo.HP_OSS
  147. UserExitExamples/ExitDemo/Makefile_exit_demo.LINUX
  148. UserExitExamples/ExitDemo/Makefile_exit_demo.AIX
  149. UserExitExamples/ExitDemo_pk_befores/
  150. UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.vcproj
  151. UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.HPUX
  152. UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.AIX
  153. UserExitExamples/ExitDemo_pk_befores/readme.txt
  154. UserExitExamples/ExitDemo_pk_befores/exitdemo_pk_befores.c
  155. UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.LINUX
  156. UserExitExamples/ExitDemo_pk_befores/Makefile_pk_befores.SOLARIS
  157. usrdecs.h
  158. zlib.txt

  159. 6、解壓縮完之後,執行ggsci命令進入OGG互動介面
  160. [oracle@source ogg]$GGSCI
  161. GGSCI (source) 1>

  162. 7、建立OGG所需目錄
  163. GGSCI (source) 1> create subdirs

  164. Creating subdirectories under current directory /DBSoft/ogg

  165. Parameter files /DBSoft/ogg/dirprm: created
  166. Report files /DBSoft/ogg/dirrpt: created
  167. Checkpoint files /DBSoft/ogg/dirchk: created
  168. Process status files /DBSoft/ogg/dirpcs: created
  169. SQL script files /DBSoft/ogg/dirsql: created
  170. Database definitions files /DBSoft/ogg/dirdef: created
  171. Extract data files /DBSoft/ogg/dirdat: created
  172. Temporary files /DBSoft/ogg/dirtmp: created
  173. Veridata files /DBSoft/ogg/dirver: created
  174. Veridata Lock files /DBSoft/ogg/dirver/lock: created
  175. Veridata Out-Of-Sync files /DBSoft/ogg/dirver/oos: created
  176. Veridata Out-Of-Sync XML files /DBSoft/ogg/dirver/oosxml: created
  177. Veridata Parameter files /DBSoft/ogg/dirver/params: created
  178. Veridata Report files /DBSoft/ogg/dirver/report: created
  179. Veridata Status files /DBSoft/ogg/dirver/status: created
  180. Veridata Trace files /DBSoft/ogg/dirver/trace: created
  181. Stdout files /DBSoft/ogg/dirout: created


  182. GGSCI (source) 2>exit

  183. 8、至此我們可以看到目錄已經建立,OGG安裝初始化完成
  184. [oracle@source ogg]$ ls -ltr dir*
  185. dirver:
  186. total 28
  187. drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 trace
  188. drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 status
  189. drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 report
  190. drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 params
  191. drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 oosxml
  192. drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 oos
  193. drwxrwxr-x 2 oracle oinstall 4096 Sep 2 21:02 lock
二、源庫配置OGG所需環境[源端,目標端]
  1. 9、開啟歸檔和附加資訊到redo logfile
  2. SQL> alter database add supplemental log data; ----開啟附加資訊到redo logfile

  3. Database altered.

  4. SQL> shutdown immediate
  5. Database closed.
  6. Database dismounted.
  7. ORACLE instance shut down.

  8. SQL> startup mount;
  9. ORACLE instance started.

  10. Total System Global Area 2505338880 bytes
  11. Fixed Size 2255832 bytes
  12. Variable Size 620758056 bytes
  13. Database Buffers 1862270976 bytes
  14. Redo Buffers 20054016 bytes
  15. Database mounted.
  16. SQL> alter database archivelog;

  17. Database altered.

  18. SQL> alter database open;

  19. Database altered.


  20. SQL> alter system switch logfile;

  21. System altered.

  22. SQL> /

  23. System altered.

  24. SQL> select SUPPLEMENTAL_LOG_DATA_MIN from v$database;

  25. SUPPLEME
  26. --------
  27. YES


  28. 10、建立OGG測試所需表空間及使用者
  29. SQL> select tablespace_name,contents from dba_tablespaces;

  30. TABLESPACE_NAME CONTENTS
  31. ------------------------------ ---------
  32. SYSTEM PERMANENT
  33. SYSAUX PERMANENT
  34. UNDOTBS1 UNDO
  35. TEMP TEMPORARY
  36. USERS PERMANENT

  37. SQL> select file_name from dba_data_files;

  38. FILE_NAME
  39. --------------------------------------------------------------------------------
  40. /DBData/woo/users01.dbf
  41. /DBData/woo/undotbs01.dbf
  42. /DBData/woo/sysaux01.dbf
  43. /DBData/woo/system01.dbf

  44. SQL> create tablespace ggs datafile \
三、透過剛才建立的使用者建立ogg所需的demo
  1. [oracle@source ogg]$ ll /DBSoft/ogg/demo*
  2. -r--r--r-- 1 oracle oinstall 1217 Mar 13 2010 /DBSoft/ogg/demo_more_ora_create.sql
  3. -r--r--r-- 1 oracle oinstall 967 Mar 13 2010 /DBSoft/ogg/demo_more_ora_insert.sql
  4. -r--r--r-- 1 oracle oinstall 883 Mar 13 2010 /DBSoft/ogg/demo_ora_create.sql
  5. -r--r--r-- 1 oracle oinstall 821 Mar 13 2010 /DBSoft/ogg/demo_ora_insert.sql
  6. -r--r--r-- 1 oracle oinstall 4015 Mar 13 2010 /DBSoft/ogg/demo_ora_lob_create.sql
  7. -r--r--r-- 1 oracle oinstall 2275 Mar 13 2010 /DBSoft/ogg/demo_ora_misc.sql
  8. -r--r--r-- 1 oracle oinstall 1269 Mar 13 2010 /DBSoft/ogg/demo_ora_pk_befores_create.sql
  9. -r--r--r-- 1 oracle oinstall 1227 Mar 13 2010 /DBSoft/ogg/demo_ora_pk_befores_insert.sql
  10. -r--r--r-- 1 oracle oinstall 2520 Mar 13 2010 /DBSoft/ogg/demo_ora_pk_befores_updates.sql

  11. SQL> @/DBSoft/ogg/demo_ora_create.sql

  12. Table created.

  13. Table created.


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

  15. 1 row created.


  16. 1 row created.


  17. 1 row created.


  18. 1 row created.


  19. Commit complete.

  20. 11、在源端和目標端查詢剛才建立的表
  21. SQL> col object_name format a15
  22. SQL> select object_name,object_type from user_objects;

  23. OBJECT_NAME OBJECT_TYPE
  24. --------------- -------------------
  25. SYS_C0011106 INDEX
  26. TCUSTMER TABLE
  27. TCUSTORD TABLE
  28. SYS_C0011107 INDEX

  29. SQL>

  30. 12、僅在源端查詢表中所插入的資料,目標端應為空表
  31. SQL> select * from tcustord;

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

  36. SQL> select * from tcustmer;

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

  41. SQL>
###Prepare the Environment
###
四、配置ogg mgr程式
  1. 13、配置mgr程式[源端,目標端]
  2. [oracle@source ogg]$ ggsci

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

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



  7. GGSCI (source) 1> edit params mgr ----新增如下兩行內容

  8. --This is the minimal configuration of manager process
  9. PORT 7809


  10. ###透過系統命令檢視剛才配置的,實際上將配置寫入了一個檔案

  11. [oracle@source ogg]$ cd dirprm/

  12. [oracle@source dirprm]$ pwd
  13. /DBSoft/ogg/dirprm

  14. [oracle@source dirprm]$ ls
  15. mgr.prm

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


  19. 14、啟動mgr,及檢視mgr狀態[源端、目標端]
  20. GGSCI (source) 1> start mgr

  21. Manager started.


  22. GGSCI (source) 2> info mgr

  23. Manager is running (IP port source.7809).

  24. [oracle@source ogg]$ ps -ef|grep mgr
  25. 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


  26. 15、檢視mgr程式資訊[源端、目標端]
  27. GGSCI (source) 3> view report mgr


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


  34.                     Starting at 2014-09-03 16:14:10
  35. ***********************************************************************

  36. Operating System Version:
  37. Linux
  38. Version #1 SMP Fri Jan 27 17:17:51 EST 2012, Release 2.6.18-308.el5
  39. Node: source
  40. Machine: x86_64
  41.                          soft limit hard limit
  42. Address Space Size : unlimited unlimited
  43. Heap Size : unlimited unlimited
  44. File Size : unlimited unlimited
  45. CPU Time : unlimited unlimited

  46. Process id: 6185

  47. Parameters...

  48. --This is the minimal configuration of manager process
  49. PORT 7809


  50. ***********************************************************************
  51. ** Run Time Messages **
  52. ***********************************************************************


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


  54. 16、在源端連結oracle資料庫並配置需要同步的表
  55. GGSCI (source) 1> dblogin userid system, password oracle

  56. GGSCI (source) 3> add trandata ggs.tcustmer

  57. Successfully logged into database.

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

  59. GGSCI (source) 4> add trandata ggs.tcustord

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

  61. 17、檢視需要同步的表的資訊
  62. GGSCI (source) 6> info trandata ggs.*

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

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


  65. ####initLoad
五、配置ogg extract程式
  1. 18、源端配置extract抽取程式
  2. GGSCI (source) 2> add extract einikk, SOURCEISTABLE
  3. EXTRACT added.

  4. GGSCI (source) 10> info extract *,tasks ----檢視程式資訊

  5. EXTRACT EINIKK Initialized 2014-09-03 17:03 Status STOPPED
  6. Checkpoint Lag Not Available
  7. Log Read Checkpoint Not Available
  8.                      First Record Record 0
  9. Task SOURCEISTABLE

  10. GGSCI (source) 3> edit params einik
  11. --
  12. -- GoldenGate Initial Data Capture
  13. -- for TCUSTMER and TCUSTORD
  14. --
  15. EXTRACT EINIKK
  16. USERID system , PASSWORD “oracle”
  17. 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=)

    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=)

    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

六、驗證初始化是否成功

  1. 23、在目標端檢視錶資訊是否進來了,我們可以看到表資料已經傳輸過來了。
  2. SQL> select * from tcustmer;

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

  7. SQL> select * from tcustord;

  8. CUST ORDER_DAT PRODUCT_ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID
  9. ---- --------- -------- ---------- ------------- -------------- --------------
  10. WILL 30-SEP-94 CAR 144 17520 3 100
  11. JANE 11-NOV-95 PLANE 256 133300 1 100
七、配置實時同步
  1. 24、在源端新增抓取程式
  2. GGSCI (source) 39> add extract eorakk, tranlog, begin now, threads 1
  3. EXTRACT added.


  4. GGSCI (source) 40> info extract * --檢視抓取程式資訊

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

  9. GGSCI (source) 41> edit params eorakk ---編輯抓取程式引數
  10. EXTRACT EORAKK
  11. USERID system, PASSWORD oracle
  12. RMTHOST 192.168.7.21, MGRPORT 7809
  13. RMTTRAIL ./dirdat/kk
  14. TABLE ggs.TCUSTMER;
  15. TABLE ggs.TCUSTORD;

  16. GGSCI (source) 42> ADD RMTTRAIL ./dirdat/kk, EXTRACT EORAKK, MEGABYTES 5 ---新增TRAIL
  17. RMTTRAIL added.

  18. GGSCI (source) 43> info rmttrail *

  19.        Extract Trail: ./dirdat/kk
  20.              Extract: EORAKK
  21.                Seqno: 0
  22.                  RBA: 0
  23.            File Size: 5M

  24. GGSCI (source) 44> start extract eorakk ---啟動TRAIL

  25. Sending START request to MANAGER ...
  26. EXTRACT EORAKK starting


  27. GGSCI (source) 45> info all

  28. Program Status Group Lag Time Since Chkpt

  29. MANAGER RUNNING
  30. EXTRACT RUNNING EORAKK 00:00:00 00:08:57


  31. GGSCI (source) 46> info extract eorakk, detail

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

  36.   Target Extract Trails:

  37.   Remote Trail Name Seqno RBA Max MB

  38.   ./dirdat/kk 0 921 5

  39.   Extract Source Begin End

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


  42. Current directory /DBSoft/ogg

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


  49. GGSCI (source) 47> view report eorakk


  50. ***********************************************************************
  51.                  Oracle GoldenGate Capture for Oracle
  52.                      Version 11.1.1.0.0 Build 078
  53.    Linux, x64, 64bit (optimized), Oracle 11 on Jul 28 2010 14:58:37
  54.  
  55. Copyright (C) 1995, 2010, Oracle and/or its affiliates. All rights reserved.


  56.                     Starting at 2014-09-04 14:35:44
  57. ***********************************************************************

  58. Operating System Version:
  59. Linux
  60. Version #1 SMP Fri Jan 27 17:17:51 EST 2012, Release 2.6.18-308.el5
  61. Node: source
  62. Machine: x86_64
  63.                          soft limit hard limit
  64. Address Space Size : unlimited unlimited
  65. Heap Size : unlimited unlimited
  66. File Size : unlimited unlimited
  67. CPU Time : unlimited unlimited

  68. Process id: 3961

  69. Description:

  70. ***********************************************************************
  71. ** Running with the following parameters **
  72. ***********************************************************************
  73. --
  74. -- Change Capture parameter file to capture
  75. -- TCUSTMER and TCUSTORD Changes
  76. --
  77. EXTRACT EORAKK
  78. USERID system, PASSWORD ******
  79. RMTHOST 192.168.7.21, MGRPORT 7809
  80. RMTTRAIL ./dirdat/kk
  81. TABLE ggs.TCUSTMER;
  82. TABLE ggs.TCUSTORD;

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

  84. Bounded Recovery Parameter:
  85. Options = BRRESET
  86. BRINTERVAL = 4HOURS
  87. BRDIR = /DBSoft/ogg

  88. CACHEMGR virtual memory values (may have been adjusted)
  89. CACHEBUFFERSIZE: 64K
  90. CACHESIZE: 8G
  91. CACHEBUFFERSIZE (soft max): 4M
  92. CACHEPAGEOUTSIZE (normal): 4M
  93. PROCESS VM AVAIL FROM OS (min): 16G
  94. CACHESIZEMAX (strict force to disk): 13.99G

  95. Database Version:
  96. Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  97. PL/SQL Release 11.2.0.4.0 - Production
  98. CORE 11.2.0.4.0 Production
  99. TNS for Linux: Version 11.2.0.4.0 - Production
  100. NLSRTL Version 11.2.0.4.0 - Production

  101. Database Language and Character Set:
  102. NLS_LANG environment variable specified has invalid format, default value will be used.
  103. NLS_LANG environment variable not set, using default value AMERICAN_AMERICA.US7ASCII.
  104. NLS_LANGUAGE = \



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8494287/viewspace-1355056/,如需轉載,請註明出處,否則將追究法律責任。