Oracle GoldenGate 簡單實驗

luckyfriends發表於2015-04-02

1windows下安裝GG

H:\OracleGoldenGate\gg_windows\ggsci.exe

2linux下安裝GG

[oracle@myCentOS ~]$ cd /mnt/winshare/OracleGoldenGate/gg_linux

[oracle@myCentOS gg_linux]$ sh ./ggsci

./ggsci: ./ggsci: cannot execute binary file

[oracle@myCentOS gg_linux]$ ./ggsci

 

Oracle GoldenGate Command Interpreter for Oracle

Version 11.1.1.0.0 Build 078

Linux, x86, 32bit (optimized), Oracle 10 on Jul 28 2010 13:24:18

 

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

 

GGSCI (myCentOS) 1> create subdirs

 

Creating subdirectories under current directory /mnt/winshare/OracleGoldenGate/gg_linux

 

Parameter files                /mnt/winshare/OracleGoldenGate/gg_linux/dirprm: created

Report files                   /mnt/winshare/OracleGoldenGate/gg_linux/dirrpt: created

Checkpoint files               /mnt/winshare/OracleGoldenGate/gg_linux/dirchk: created

Process status files           /mnt/winshare/OracleGoldenGate/gg_linux/dirpcs: created

SQL script. files               /mnt/winshare/OracleGoldenGate/gg_linux/dirsql: created

Database definitions files     /mnt/winshare/OracleGoldenGate/gg_linux/dirdef: created

Extract data files             /mnt/winshare/OracleGoldenGate/gg_linux/dirdat: created

Temporary files                /mnt/winshare/OracleGoldenGate/gg_linux/dirtmp: created

Veridata files                 /mnt/winshare/OracleGoldenGate/gg_linux/dirver: created

Veridata Lock files            /mnt/winshare/OracleGoldenGate/gg_linux/dirver/lock: created

Veridata Out-Of-Sync files     /mnt/winshare/OracleGoldenGate/gg_linux/dirver/oos: created

Veridata Out-Of-Sync XML files /mnt/winshare/OracleGoldenGate/gg_linux/dirver/oosxml: created

Veridata Parameter files       /mnt/winshare/OracleGoldenGate/gg_linux/dirver/params: created

Veridata Report files          /mnt/winshare/OracleGoldenGate/gg_linux/dirver/report: created

Veridata Status files          /mnt/winshare/OracleGoldenGate/gg_linux/dirver/status: created

Veridata Trace files           /mnt/winshare/OracleGoldenGate/gg_linux/dirver/trace: created

Stdout files                   /mnt/winshare/OracleGoldenGate/gg_linux/dirout: created

 

GGSCI (myCentOS) 2>

 

設定linux環境變數:

GGS_HOME=/mnt/winshare/OracleGoldenGate/gg_linux

export GGS_HOME

LD_LIBRARY_PATH=$GGS_HOME:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH

PATH=$GGS_HOME:$PATH

export PATH

 

[oracle@myCentOS gg_linux]$ GGS_HOME=/mnt/winshare/OracleGoldenGate/gg_linux

[oracle@myCentOS gg_linux]$ export GGS_HOME

[oracle@myCentOS gg_linux]$ LD_LIBRARY_PATH=$GGS_HOME:$LD_LIBRARY_PATH

[oracle@myCentOS gg_linux]$ export LD_LIBRARY_PATH

[oracle@myCentOS gg_linux]$ PATH=$GGS_HOME:$PATH

[oracle@myCentOS gg_linux]$ export PATH

[oracle@myCentOS gg_linux]$ source ~/.bash_profile

[oracle@myCentOS gg_linux]$ echo $GGS_HOME

/mnt/winshare/OracleGoldenGate/gg_linux

[oracle@myCentOS gg_linux]$

3、開啟資料庫附加日誌

C:\Documents and Settings\Administrator>set oracle_sid=test

 

C:\Documents and Settings\Administrator>sqlplus sys/ymh as sysdba;

 

SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 7 20 13:18:28 2011

 

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

  

連線到:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

 

SQL> alter system checkpoint;

 

系統已更改。

 

SQL> alter database add supplemental log data;

 

資料庫已更改。

4、下面執行幾個指令碼,建立GGMGR使用者

SQL> CREATE USER ggmgr IDENTIFIED BY ymh  TEMPORARY TABLESPACE TEMP;

 

使用者已建立。

 

SQL> GRANT create table to ggmgr;

 

授權成功。

 

SQL> GRANT CONNECT TO ggmgr;

 

授權成功。

 

SQL> GRANT ALTER ANY  TABLE TO ggmgr;

 

授權成功。

 

SQL> GRANT ALTER SESSION TO ggmgr;

 

授權成功。

 

SQL> GRANT CREATE SESSION TO ggmgr;

 

授權成功。

 

SQL> GRANT FLASHBACK ANY TABLE TO ggmgr;

 

授權成功。

 

SQL> GRANT SELECT ANY DICTIONARY TO ggmgr;

 

授權成功。

 

SQL> GRANT SELECT ANY TABLE TO ggmgr;

 

授權成功。

 

SQL> GRANT "RESOURCE" TO ggmgr;

 

授權成功。

 

SQL> GRANT DELETE ANY TABLE TO ggmgr;

 

授權成功。

 

SQL> GRANT INSERT ANY TABLE TO ggmgr;

 

授權成功。

 

SQL> GRANT UPDATE ANY TABLE TO ggmgr;

 

授權成功。

 

SQL> GRANT RESTRICTED SESSION TO ggmgr;

 

授權成功。

5、建立測試表

SQL> CREATE TABLE ggmgr.T_TEST_CONN_FOR_GG(

  2  TESTER VARCHAR2(30) CONSTRAINT NN_T_TEST_CONN_FOR_GG_TESTER NOT NULL,

  3  SOURCE_DATABASE VARCHAR2(10) CONSTRAINT NN_T_TEST_CONN_FOR_GG_SOURCE NOT NULL,

  4  TARGET_DATABASE VARCHAR2(10) CONSTRAINT NN_T_TEST_CONN_FOR_GG_TARGET NOT NULL,

  5  TEST_TIME DATE DEFAULT SYSDATE,

  6  Constraint PK_TEST_CONN_FOR_GG primary KEY (TESTER, SOURCE_DATABASE, TARGET_DATABASE, TEST_TIME) USING INDEX );

 

表已建立。

 

SQL> COMMENT ON COLUMN ggmgr.T_TEST_CONN_FOR_GG.TESTER IS '測試人員UM賬號';

 

註釋已建立。

 

SQL> COMMENT ON COLUMN ggmgr.T_TEST_CONN_FOR_GG.SOURCE_DATABASE IS '源資料庫SID';

 

註釋已建立。

 

SQL> COMMENT ON COLUMN ggmgr.T_TEST_CONN_FOR_GG.TARGET_DATABASE IS '目標資料庫SID';

 

註釋已建立。

 

SQL> COMMENT ON COLUMN ggmgr.T_TEST_CONN_FOR_GG.TEST_TIME IS '測試時間';

 

註釋已建立。

 

SQL> COMMENT ON TABLE ggmgr.T_TEST_CONN_FOR_GG is 'GoldenGate連通性測試表';

 

註釋已建立。

6、在linux下建立目標使用者和目標表:

SQL> CREATE USER ggmgr_target IDENTIFIED BY ymh TEMPORARY TABLESPACE TEMP;

GRANT create table to ggmgr_target;

GRANT CONNECT TO ggmgr_target;

GRANT ALTER ANY TABLE TO ggmgr_target;

GRANT ALTER SESSION TO ggmgr_target;

GRANT CREATE SESSION TO ggmgr_target;

GRANT FLASHBACK ANY TABLE TO ggmgr_target;

GRANT SELECT ANY DICTIONARY TO ggmgr_target;

GRANT SELECT ANY TABLE TO ggmgr_target;

GRANT "RESOURCE" TO ggmgr_target;

GRANT DELETE ANY TABLE TO ggmgr_target;

GRANT INSERT ANY TABLE TO ggmgr_target;

GRANT UPDATE ANY TABLE TO ggmgr_target;

grant restricted session to ggmgr_target;

 

User created.

 

SQL>

Grant succeeded.

 

建立接收表

 

SQL> CREATE TABLE ggmgr_target.T_TEST_CONN_FOR_GG_target(

  2      TESTER VARCHAR2(30) CONSTRAINT NN_T_TEST_CONN_FOR_GG_TESTER NOT NULL,

  3      SOURCE_DATABASE VARCHAR2(10) CONSTRAINT NN_T_TEST_CONN_FOR_GG_SOURCE NOT NULL,

  4      TARGET_DATABASE VARCHAR2(10) CONSTRAINT NN_T_TEST_CONN_FOR_GG_TARGET NOT NULL,

  5      TEST_TIME DATE DEFAULT SYSDATE,

  6      Constraint PK_TEST_CONN_FOR_GG_target primary KEY (TESTER, SOURCE_DATABASE, TARGET_DATABASE, TEST_TIME) USING INDEX );

 

Table created

7、接下來就是搭建和配置程式了

源庫需要 MGR E T程式

目標庫要 MGR,F,R程式

7.1windows下源庫程式:

7.1.1設定引數

C:\>h:

 

H:\>cd H:\OracleGoldenGate\gg_windows

 

H:\OracleGoldenGate\gg_windows>set oracle_sid=test

 

H:\OracleGoldenGate\gg_windows>ggsci.exe

 

Oracle GoldenGate Command Interpreter for Oracle

Version 11.1.1.0.0 Build 078

Windows (optimized), Oracle 10 on Jul 28 2010 15:07:26

 

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

 

GGSCI (ymh-5a3854c5a1e) 1> EDIT PARAMS ./GLOBALS

CHECKPOINTTABLE ggmgr.gg_checkpoint_tab

 

GGSCI (ymh-5a3854c5a1e) 2>  DBLOGIN USERID ggmgr, PASSWORD ymh

Successfully logged into database.

 

GGSCI (ymh-5a3854c5a1e) 3> ADD CHECKPOINTTABLE ggmgr.gg_checkpoint_tab

 

Successfully created checkpoint table GGMGR.GG_CHECKPOINT_TAB.

 

GGSCI (ymh-5a3854c5a1e) 4> exit

 

H:\OracleGoldenGate\gg_windows>

7.1.2建立GG環境變數的目錄

H:\OracleGoldenGate\gg_windows>mkdir direnv

 

H:\OracleGoldenGate\gg_windows>cd direnv

 

H:\OracleGoldenGate\gg_windows\direnv>

 

H:\OracleGoldenGate\gg_windows\direnv>notepad user.oby

userid ggmgr, password  ymh

H:\OracleGoldenGate\gg_windows\direnv>

 

H:\OracleGoldenGate\gg_windows\direnv>notepad db.oby

setenv (ORACEL_SID="test")

H:\OracleGoldenGate\gg_windows\direnv>

 

H:\OracleGoldenGate\gg_windows\direnv>notepad rmt_to_shujukuai.oby

rmthost 192.168.1.150 mgrport 7809

H:\OracleGoldenGate\gg_windows\direnv>

7.1.3建立MGR程式

H:\OracleGoldenGate\gg_windows\direnv>cd ..

 

H:\OracleGoldenGate\gg_windows>ggsci

 

Oracle GoldenGate Command Interpreter for Oracle

Version 11.1.1.0.0 Build 078

Windows (optimized), Oracle 10 on Jul 28 2010 15:07:26

 

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

 

GGSCI (ymh-5a3854c5a1e) 1> edit param mgr

port 7809

dynamicportlist 7809-7909

autostart er *

autorestart er *, retries 24, waitminutes 30, resetminutes 1440

lagreportminutes 10

laginfoseconds 1

purgeoldextracts ./dirdat/*, usecheckpoints, minkeephours 168

 

GGSCI (ymh-5a3854c5a1e) 2>

 

啟動:

GGSCI (ymh-5a3854c5a1e) 2> start mgr

 

Manager started.

  

GGSCI (ymh-5a3854c5a1e) 3> info mgr

 

Manager is running (IP port ymh-5a3854c5a1e.7809).

 

GGSCI (ymh-5a3854c5a1e) 4>

 

開啟表級附加日誌:

 

GGSCI (ymh-5a3854c5a1e) 4> dblogin userid ggmgr, password ymh

Successfully logged into database.

 

GGSCI (ymh-5a3854c5a1e) 5> add trandata GGMGR.T_TEST_CONN_FOR_GG

 

Logging of supplemental redo data enabled for table GGMGR.T_TEST_CONN_FOR_GG.

 

GGSCI (ymh-5a3854c5a1e) 6> INFO TRANDATA GGMGR.T_TEST_CONN_FOR_GG

 

Logging of supplemental redo log data is enabled for table GGMGR.T_TEST_CONN_FOR_GG

 

GGSCI (ymh-5a3854c5a1e) 7>

7.1.4下面我們開始配置EXTRACT 程式引數檔案

GGSCI (ymh-5a3854c5a1e) 7> edit param E_TEST

EXTRACT E_TEST

obey ./direnv/db.oby

obey ./direnv/user.oby

TRANLOGOPTIONS EXCLUDEUSER ggmgr

EXTTRAIL ./dirdat/e0        

TABLE GGMGR.T_TEST_CONN_FOR_GG;

 

GGSCI (ymh-5a3854c5a1e) 8>

 

EXTRACT程式的引數檔案配好了,現在我需要把這個程式初始化

exract程式初始化

GGSCI (ymh-5a3854c5a1e) 8> ADD EXTRACT E_TEST, TRANLOG, BEGIN NOW

EXTRACT added.

 

 

GGSCI (ymh-5a3854c5a1e) 9> ADD EXTTRAIL ./dirdat/e0, EXTRACT E_TEST, MEGABYTES 50

EXTTRAIL added.

  

GGSCI (ymh-5a3854c5a1e) 10> info all

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING

EXTRACT     STOPPED     E_TEST      00:00:00      00:00:13

  

GGSCI (ymh-5a3854c5a1e) 11>

7.1.5下面一步,我就要新增DATAPUMP程式了

 GGSCI (ymh-5a3854c5a1e) 11> EDIT PARAM T_TEST

EXTRACT E_TEST

obey ./direnv/db.oby

obey ./direnv/user.oby

TRANLOGOPTIONS EXCLUDEUSER ggmgr

EXTTRAIL ./dirdat/e0        

TABLE GGMGR.T_TEST_CONN_FOR_GG;

  

GGSCI (ymh-5a3854c5a1e) 12>

新增該程式:

GGSCI (ymh-5a3854c5a1e) 12> ADD EXTRACT T_TEST, EXTTRAILSOURCE ./dirdat/e0

EXTRACT added.

  

GGSCI (ymh-5a3854c5a1e) 13> ADD RMTTRAIL ./dirdat/d0, EXTRACT T_TEST, MEGABYTES 50

RMTTRAIL added.

  

GGSCI (ymh-5a3854c5a1e) 14>

 

GGSCI (ymh-5a3854c5a1e) 14> info all

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING

EXTRACT     STOPPED     E_TEST      00:00:00      00:05:14

EXTRACT     STOPPED     T_TEST      00:00:00      00:00:40

  

GGSCI (ymh-5a3854c5a1e) 15>

7.1.6下面我要生成表定義檔案

GGSCI (ymh-5a3854c5a1e) 15> exit

 

H:\OracleGoldenGate\gg_windows>cd dirprm

 

H:\OracleGoldenGate\gg_windows\dirprm>notepad test.prm

DEFSFILE ./dirdef/test.def, PURGE

obey ./direnv/user.oby

TABLE ggmgr.T_TEST_CONN_FOR_GG;

 

H:\OracleGoldenGate\gg_windows\dirprm>cd ..

 

下一步就是生成表定義檔案test.def

 

H:\OracleGoldenGate\gg_windows>defgen paramfile dirprm/test.prm

 

***********************************************************************

        Oracle GoldenGate Table Definition Generator for Oracle

                     Version 11.1.1.0.0 Build 078

        Windows (optimized), Oracle 10 on Jul 28 2010 15:40:43

 

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

 

 

                    Starting at 2011-07-20 14:46:55

***********************************************************************

 

Operating System Version:

Microsoft Windows Server 2003, Enterprise Edition, on x86

Version 5.2 (Build 3790: Service Pack 2)

 

Process id: 5372

 

***********************************************************************

**            Running with the following parameters                  **

***********************************************************************

DEFSFILE ./dirdef/test.def, PURGE

obey ./direnv/user.oby

userid ggmgr, password ***

TABLE ggmgr.T_TEST_CONN_FOR_GG;

Retrieving definition for GGMGR.T_TEST_CONN_FOR_GG

 

Definitions generated for 1 tables in ./dirdef/test.def

 

H:\OracleGoldenGate\gg_windows>

 

錯誤:因為臨時表空間沒有資料檔案導致(庫被我還原過,臨時表空間不會被恢復)

2011-07-20 14:23:45  ERROR   OGG-00664  OCI Error creating temporary LOB to retrieve default LOB chunk size (status = 25153-ORA-25153: Temporary Tablespace is Empty).

 

2011-07-20 14:23:45  ERROR   OGG-01668  PROCESS ABENDING.

 

錯誤:注意檢查之前的配置檔案中的連線串,賬號密碼等

2011-07-20 14:12:21  ERROR   OGG-00664  OCI Error beginning session (status = 1017-ORA-01017: invalid username/password; logon denied).

 

2011-07-20 14:12:21  ERROR   OGG-01668  PROCESS ABENDING.

 

注意:如果目標端不在本機

應該將此檔案上傳到目標庫GGS_HOME/dirdef

要不然目標端不認識你這邊定義表的

源庫這邊配置完成了

 

 

7.2下面來配置目標庫的:linux下的:

7.2.1配置引數

[oracle@myCentOS gg_linux]$ ls dirdef

test.def

[oracle@myCentOS gg_linux]$ mkdir direnv

[oracle@myCentOS gg_linux]$ cd direnv

[oracle@myCentOS direnv]$ vi user.oby

 

userid ggmgr_target,password ymh

~                                                                               

[oracle@myCentOS direnv]$ vi db.oby

 

setenv (ORACEL_SID="orcl")

~                                                                           

[oracle@myCentOS direnv]$

 

GGSCI (myCentOS) 6> EDIT PARAMS ./GLOBALS

 

CHECKPOINTTABLE ggmgr_target.gg_checkpoint_tab

 

GGSCI (myCentOS) 7> DBLOGIN USERID ggmgr_target,PASSWORD YMH

Successfully logged into database.

 

GGSCI (myCentOS) 8> ADD CHECKPOINTTABLE ggmgr_target.gg_checkpoint_tab

 

Successfully created checkpoint table GGMGR_TARGET.GG_CHECKPOINT_TAB.

 

GGSCI (myCentOS) 9> ^[ 

 

7.2.1配置mgr

[oracle@myCentOS gg_linux]$ ./ggsci

 

Oracle GoldenGate Command Interpreter for Oracle

Version 11.1.1.0.0 Build 078

Linux, x86, 32bit (optimized), Oracle 10 on Jul 28 2010 13:24:18

 

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

 

GGSCI (myCentOS) 1> edit param mgr

 

port 7809

dynamicportlist 7809-7909

autostart er *

autorestart er *, retries 24, waitminutes 30, resetminutes 1440

lagreportminutes 10

laginfoseconds 1

purgeoldextracts ./dirdat/*, usecheckpoints, minkeephours 168

 

GGSCI (myCentOS) 2> start mgr

 

Manager started.

 

GGSCI (myCentOS) 3> info all

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING                                          

 

GGSCI (myCentOS) 4>

7.2.2配置接收程式

GGSCI (myCentOS) 4> edit param f_test

 

EXTRACT F_TEST

bey ./direnv/db.oby

obey ./direnv/user.oby

SOURCEDEFS ./dirdef/test.def

EXTTRAIL ./dirdat/f0

TABLE ggmgr.T_TEST_CONN_FOR_GG;

 

GGSCI (myCentOS) 1> ADD EXTRACT F_TEST, EXTTRAILSOURCE ./dirdat/d0

EXTRACT added.

 

GGSCI (myCentOS) 2> ADD RMTTRAIL ./dirdat/f0, EXTRACT F_TEST, MEGABYTES 50

RMTTRAIL added.

 

GGSCI (myCentOS) 3> info all

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING                                          

EXTRACT     STOPPED     F_TEST      00:00:00      00:00:11   

7.2.3 配置

GGSCI (myCentOS) 4> EDIT PARAM R_TEST

 

REPLICAT r_test

obey ./direnv/db.oby

obey ./direnv/user.oby

SOURCEDEFS ./dirdef/test.def

CHECKPOINTSECS 30

GROUPTRANSOPS 20000

MAXTRANSOPS 30000

REPERROR DEFAULT, ABEND

DISCARDFILE ./dirrpt/r_test.dsc, append, MEGABYTES 2000

DISCARDROLLOVER AT 05:30 ON friday

REPORTCOUNT EVERY 10000 RECORDS, RATE

-- Resolve meta. data for table def as it appears in log record

WILDCARDRESOLVE DYNAMIC

ALLOWDUPTARGETMAP

map ggmgr.T_TEST_CONN_FOR_GG , TARGET ggmgr_target.T_TEST_CONN_FOR_GG_TARGET;

 

GGSCI (myCentOS) 5>

 

GGSCI (myCentOS) 1> ADD REPLICAT R_test, EXTTRAIL ./dirdat/f0

REPLICAT added.

 

GGSCI (myCentOS) 2>

 

錯誤:沒有配置checkpoint table,要記得配置後最好退出GGSCI再進入生成

GGSCI (myCentOS) 11> ADD REPLICAT R_test, EXTTRAIL ./dirdat/f0

ERROR: No checkpoint table specified for ADD REPLICAT.

8、配置完成,啟動服務

8.1啟動windows源端的

GGSCI (ymh-5a3854c5a1e) 1> start *

 

ERROR: Manager not currently running.

 

ERROR: Manager not currently running.

  

GGSCI (ymh-5a3854c5a1e) 2> start mgr

 

Manager started.

  

GGSCI (ymh-5a3854c5a1e) 3> info all

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING

EXTRACT     RUNNING     E_TEST      00:00:00      00:00:00

EXTRACT     RUNNING     T_TEST      00:00:00      00:00:07

  

GGSCI (ymh-5a3854c5a1e) 4>

8.2啟動linux服務端的

GGSCI (myCentOS) 7> start mgr

 

Manager started.

  

GGSCI (myCentOS) 8> info all

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING                                          

EXTRACT     STOPPED     F_TEST      00:00:00      00:17:45   

REPLICAT    RUNNING     R_TEST      00:00:00      00:00:01   

  

GGSCI (myCentOS) 9> info all

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING                                          

EXTRACT     STOPPED     F_TEST      00:00:00      00:17:49   

REPLICAT    RUNNING     R_TEST      00:00:00      00:00:06   

  

GGSCI (myCentOS) 10>

 

錯誤了,檢查:

GGSCI (myCentOS) 11> view report f_test

 

 

***********************************************************************

                 Oracle GoldenGate Capture for Oracle

                     Version 11.1.1.0.0 Build 078

   Linux, x86, 32bit (optimized), Oracle 10 on Jul 28 2010 16:16:35

 

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

 

 

                    Starting at 2011-07-20 20:20:24

***********************************************************************

 

Operating System Version:

Linux

Version #1 SMP Fri Apr 2 14:58:35 EDT 2010, Release 2.6.18-194.el5

Node: myCentOS

Machine: i686

                         soft limit   hard limit

Address Space Size   :    unlimited    unlimited

Heap Size            :    unlimited    unlimited

File Size            :    unlimited    unlimited

CPU Time             :    unlimited    unlimited

 

Process id: 2857

 

Description:

 

***********************************************************************

**            Running with the following parameters                  **

***********************************************************************

 

bey ./direnv/db.oby

 

Source Context :

  SourceModule            : [er.main]

  SourceID                : [/home/ecloud/workspace/Build_FBO_OpenSys_r11.1.1.0.0_078_[34090]/perforce/src/app/er/rep.c]

  SourceFunction          : [get_infile_params]

  SourceLine              : [12083]

  ThreadBacktrace         : [7] elements

                          : [/mnt/winshare/OracleGoldenGate/gg_linux/extract(CMessageContext::AddThreadContext()+0x26) [0x840b3f6]]

                          : [/mnt/winshare/OracleGoldenGate/gg_linux/extract(CMessageFactory::CreateMessage(CSourceContext*, unsigne

d int, ...)+0x817) [0x8401b57]]

                          : [/mnt/winshare/OracleGoldenGate/gg_linux/extract(_MSG_ERR_STARTUP_PARAMERROR_ERRORTEXT(CSourceContext*,

char const*, CMessageFactory::MessageDisposition)+0x81) [0x83ca581]]

                          : [/mnt/winshare/OracleGoldenGate/gg_linux/extract [0x818b0dc]]

                          : [/mnt/winshare/OracleGoldenGate/gg_linux/extract(main+0x133) [0x819cdd3]]

                          : [/lib/libc.so.6(__libc_start_main+0xdc) [0x424e9c]]

                          : [/mnt/winshare/OracleGoldenGate/gg_linux/extract(__gxx_personality_v0+0x1c5) [0x8114ac1]]

 

2011-07-20 20:20:24  ERROR   OGG-00303  Unrecognized parameter (bey).

 

2011-07-20 20:20:24  ERROR   OGG-01668  PROCESS ABENDING.

  

GGSCI (myCentOS) 12>

  

檢視最後一個一部分error資訊

引數有問題.檢查 f_test的引數edit param f_test,發現最開始少了:EXTRACT F_TEST

  

GGSCI (myCentOS) 26> start f_test

 

Sending START request to MANAGER ...

EXTRACT F_TEST starting

  

GGSCI (myCentOS) 27> info all

 

Program     Status      Group       Lag           Time Since Chkpt

 

MANAGER     RUNNING                                          

EXTRACT     RUNNING     F_TEST      00:00:00      00:00:00   

REPLICAT    RUNNING     R_TEST      00:00:00      00:00:27   

  

GGSCI (myCentOS) 28>

 

9、測試插入資料

windows源端插入一條記錄:

SQL> insert into ggmgr.T_TEST_CONN_FOR_GG values('shujukuai','test','test1',SYSDATE);

 

已建立 1 行。

 

SQL> commit;

 

提交完成。

 

SQL>

 

linux下檢視接收進城:

GGSCI (myCentOS) 28> stats r_test

 

Sending STATS request to REPLICAT R_TEST ...

 

Start of Statistics at 2011-07-20 21:33:43.

 

Replicating from GGMGR.T_TEST_CONN_FOR_GG to GGMGR_TARGET.T_TEST_CONN_FOR_GG_TARGET:

 

*** Total statistics since 2011-07-20 21:32:42 ***

        Total inserts                                1.00

        Total updates                                0.00

        Total deletes                                0.00

        Total discards                               0.00

        Total operations                             1.00

 

*** Daily statistics since 2011-07-20 21:32:42 ***

        Total inserts                                1.00

        Total updates                                0.00

        Total deletes                                0.00

        Total discards                               0.00

        Total operations                             1.00

 

*** Hourly statistics since 2011-07-20 21:32:42 ***

        Total inserts                                1.00

        Total updates                                0.00

        Total deletes                                0.00

        Total discards                               0.00

        Total operations                             1.00

 

*** Latest statistics since 2011-07-20 21:32:42 ***

        Total inserts                                1.00

        Total updates                                0.00

        Total deletes                                0.00

        Total discards                               0.00

        Total operations                             1.00

 

End of Statistics.

  

GGSCI (myCentOS) 29>

 

查詢目標表:

 

SQL> conn sys/ymh as sysdba;

Connected.

SQL> select * from ggmgr_target.T_TEST_CONN_FOR_GG_target;

 

TESTER                         SOURCE_DAT TARGET_DAT TEST_TIME

------------------------------ ---------- ---------- ---------

shujukuai                      test       test1      20-JUL-11

 

SQL>

 

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

相關文章