ITPub博客

首页 > 数据库 > Oracle > GoldenGate单向表DML同步

GoldenGate单向表DML同步

Oracle 作者:luashin 时间:2016-01-07 20:16:12 0 删除 编辑

实验环境:
 

  node1:
  RedHat 5.5  Oracle 11.0.2.3  host:192.168.130.168
  goldengate: fbo_ggs_Linux_x64_ora11g_64bit.zip
 
  node2:
  redhat 5.5  oracle 11.0.2.3  host:192.168.130.171
  goldengate: fbo_ggs_Linux_x64_ora11g_64bit.zip
 

1. 解压goldengate软件
 
  下载地址:http://www.oracle.com/technetwork/middleware/goldengate/overview/index.html
 
  [root@dd1 soft]# ll
  total 90588
  drwxrwxrwx 8 root root    4096 Apr  7 17:19 database
  -rw-r--r-- 1 root root 92502371 Oct 29 21:05 fbo_ggs_Linux_x64_ora11g_64bit.zip
  -rwxr-xr-x 1 root root  251438 Apr  8 17:40 rlwrap-0.37.tar.gz
 
  [root@dd1 soft]# unzip fbo_ggs_Linux_x64_ora11g_64bit.zip
  Archive:  fbo_ggs_Linux_x64_ora11g_64bit.zip
    inflating: fbo_ggs_Linux_x64_ora11g_64bit.tar 
    inflating: OGG_WinUnix_Rel_Notes_11.1.1.1.2.pdf 
    inflating: Oracle_GoldenGate_11.1.1.1_README.txt
   
  解压至oracle base目录下
  [root@dd1 soft]# chmod 777 fbo_ggs_Linux_x64_ora11g_64bit.tar
  [root@dd1 soft]# su - oracle
  [root@dd1 soft]# mkdir /data/oracle/ogg11
  [oracle@dd1 ~]$ tar -xvf /opt/soft/fbo_ggs_Linux_x64_ora11g_64bit.tar -C /data/oracle/ogg11/
 
 
 
2. 配置环境变量:
    配置前bash_profile文件内容:
  [oracle@dd1 ~]$ cat .bash_profile
  # .bash_profile
 
  # Get the aliases and functions
  if [ -f ~/.bashrc ]; then
          . ~/.bashrc
  fi
 
  # User specific environment and startup programs
 
  PATH=$PATH:$HOME/bin
 
  export PATH
 
  export ORACLE_BASE=/data/oracle
  export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
  PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
  export ORACLE_SID=test1
  export PATH
 
  alias sqlplus="rlwrap sqlplus"
  alias rman="rlwrap rman"
 
  配置后:
  [oracle@dd1 ~]$ vi .bash_profile
 
  # .bash_profile
 
  # Get the aliases and functions
  if [ -f ~/.bashrc ]; then
          . ~/.bashrc
  fi
 
  # User specific environment and startup programs
 
  PATH=$PATH:$HOME/bin
 
  export PATH
 
  export ORACLE_BASE=/data/oracle
  export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
  export LD_LIBRARY_PATH=$ORACLE_BASE/ogg11 ###
  PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin:$ORACLE_BASE/ogg11 ###
  export ORACLE_SID=test1
  export PATH
 
  alias sqlplus="rlwrap sqlplus"
  alias rman="rlwrap rman"
  alias rman="rlwrap ggsci" ###
 
  [oracle@dd1 ~]$ source .bash_profile
 
  测试ggsci命令是否可用:
  [oracle@dd1 ~]$ ggsci
  ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such file or directory
 
  根据上面的报错,在bash_profile里添加$ORACLE_HOME/lib:
  export LD_LIBRARY_PATH=$ORACLE_BASE/ogg11:$ORACLE_HOME/lib
  [oracle@dd1 ~]$ source .bash_profile
  [oracle@dd1 ~]$ ggsci
  Oracle GoldenGate Command Interpreter for Oracle
  Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46
  Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  GGSCI (dd1) 1>
  可以执行了。
3. 进入ggsci 用create subdirs创建目录
    建议进入$Oracle_BASE/ogg11目录:
  [oracle@dd1 ~]$ cd $ORACLE_BASE/ogg11
  [oracle@dd1 ogg11]$ ggsci
 
  Oracle GoldenGate Command Interpreter for Oracle
  Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46
 
  Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 
 
 
  GGSCI (dd1) 1> create subdirs
 
  Creating subdirectories under current directory /data/oracle/ogg11
 
  Parameter files                /data/oracle/ogg11/dirprm: created
  Report files                  /data/oracle/ogg11/dirrpt: created
  Checkpoint files              /data/oracle/ogg11/dirchk: created
  Process status files          /data/oracle/ogg11/dirpcs: created
  SQL script files              /data/oracle/ogg11/dirsql: created
  Database definitions files    /data/oracle/ogg11/dirdef: created
  Extract data files            /data/oracle/ogg11/dirdat: created
  Temporary files                /data/oracle/ogg11/dirtmp: created
  Veridata files                /data/oracle/ogg11/dirver: created
  Veridata Lock files            /data/oracle/ogg11/dirver/lock: created
  Veridata Out-Of-Sync files    /data/oracle/ogg11/dirver/oos: created
  Veridata Out-Of-Sync XML files /data/oracle/ogg11/dirver/oosxml: created
  Veridata Parameter files      /data/oracle/ogg11/dirver/params: created
  Veridata Report files          /data/oracle/ogg11/dirver/report: created
  Veridata Status files          /data/oracle/ogg11/dirver/status: created
  Veridata Trace files          /data/oracle/ogg11/dirver/trace: created
  Stdout files                  /data/oracle/ogg11/dirout: created
 
  GGSCI (dd1) 2> exit
 
  GoldenGate安装完成,以上配置安装两个节点都要执行。
4. 对源库进行设置
 
  确认已经开启归档:
  SQL> archive log list;
  Database log mode              Archive Mode
  Automatic archival            Enabled
  Archive destination            /data/Oracle/archivelog
  Oldest online log sequence    7
  Next log sequence to archive  9
 
  添加附加日志:
  SQL> alter database add supplemental log data;
 
  Database altered.
 
  SQL> alter system switch logfile;
 
  System altered.
 
  编辑源数据库管理进程参数文件,输入端口号:
  [oracle@dd1 ~]$ cd $ORACLE_BASE/ogg11
  [oracle@dd1 ogg11]$ ggsci
 
  Oracle GoldenGate Command Interpreter for Oracle
  Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46
 
  Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 
 
 
  GGSCI (dd1) 1> edit params mgr
 
  PORT 7809
 
  启动管理进程:
  GGSCI (dd1) 2> start mgr
 
  Manager started.
 
  查看管理进程信息:
  GGSCI (dd1) 3> info mgr
  Manager is running (IP port dd1.7809).

5. 对目标库进行设置
  编辑目标库管理进程参数文件,输入端口:
  [Oracle@kf2 ~]$ cd $ORACLE_BASE/ogg11
  [oracle@kf2 ogg11]$ ggsci
 
  Oracle GoldenGate Command Interpreter for Oracle
  Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46
 
  Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 
 
 
  GGSCI (kf2.calvin) 1> edit params mgr
 
 
 
  -- this is configuration of this manager process
  PORT 7809
 
  启动管理进程:
  GGSCI (kf2.calvin) 2> start mgr
 
  Manager started.
 
  查看管理进程信息:
  GGSCI (kf2.calvin) 3> info mgr
 
  Manager is running (IP port kf2.calvin.7809).
 
 
 
6. 创建源数据库和目标数据库实验用户:
  在源数据库端建立:
  [oracle@dd1 ogg11]$ sqlplus / as sysdba
 
  SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 11:13:54 2013
 
  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
 
 
  Connected to:
  Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
  SQL> create tablespace testdata datafile'/data/oracle/oradata/test1/testdata01.dbf' size 1G;
 
  Tablespace created.
 
  SQL> create user ogguser identified by ogguser default tablespace testdata quota unlimited on testdata;
 
  User created.
 
  SQL> grant connect,resource to ogguser;
 
  Grant succeeded.
 
  SQL> conn ogguser/ogguser
  Connected.
 
  创建实验表:
  SQL> @demo_ora_create.sql
  DROP TABLE tcustmer
              *
  ERROR at line 1:
  ORA-00942: table or view does not exist
 
 
 
  Table created.
 
  DROP TABLE tcustord
              *
  ERROR at line 1:
  ORA-00942: table or view does not exist
 
 
 
  Table created.
 
  往实验表插入数据记录:
  SQL> @demo_ora_insert.sql
 
  1 row created.
 
 
  1 row created.
 
 
  1 row created.
 
 
  1 row created.
 
 
  Commit complete.
 
 

  在目标目标库端建立:
  GGSCI (kf2.calvin) 4> quit
  [oracle@kf2 ogg11]$ sqlplus / as sysdba
 
  SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 11:24:40 2013
 
  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
 
 
  Connected to:
  Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
  SQL> create tablespace testdata datafile'/data/oracle/oradata/test2/testdata01.dbf' size 1G;
 
  Tablespace created.
 
  SQL> create user ogguser identified by ogguser default tablespace testdata quota unlimited on testdata;
 
  User created.
 
  SQL> grant connect,resource to ogguser;
 
  Grant succeeded.
 
  SQL>  conn ogguser/ogguser
  Connected.
 
  目标库创建实验表,但不插入数据:
  SQL> @demo_ora_create.sql
  DROP TABLE tcustmer
              *
  ERROR at line 1:
  ORA-00942: table or view does not exist
 
 
 
  Table created.
 
  DROP TABLE tcustord
              *
  ERROR at line 1:
  ORA-00942: table or view does not exist
 
 
 
  Table created.
 
 
  查看源库表数据:
  SQL> show user
  USER is "OGGUSER"
  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
 
 
  查看目标库数据记录:
  SQL> show user
  USER is "OGGUSER"

  SQL> select * from tcustmer;
  no rows selected
 
  SQL> select * from tcustord;
  no rows selected
7. 一次性抽取源库数据到目标库:
 
  [Oracle@dd1 ogg11]$ ggsci
 
  Oracle GoldenGate Command Interpreter for Oracle
  Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46
 
  Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 
 
  GGSCI (dd1) 3> dblogin userid system,password calvin
  Successfully logged into database.
 
  GGSCI (dd1) 5> add trandata ogguser.tcustmer
 
  Logging of supplemental redo data enabled for table OGGUSER.TCUSTMER.
 
  GGSCI (dd1) 6> add trandata ogguser.tcustord
 
  Logging of supplemental redo data enabled for table OGGUSER.TCUSTORD.
 
  GGSCI (dd1) 7> info trandata ogguser.*
 
  Logging of supplemental redo log data is enabled for table OGGUSER.TCUSTMER
 
  Logging of supplemental redo log data is enabled for table OGGUSER.TCUSTORD
 
  GGSCI (dd1) 8>
 
  源库添加extrace组任务和参数文件:
  GGSCI (dd1) 8> add extract einikk,sourceistable
  EXTRACT added.
 
 
  GGSCI (dd1) 9> edit params einikk
 
 
  -- GoldenGate Inintal Data Capture
  -- for TCUSTMER and TCUSTORD
  --
  EXTRACT EINIKK
  USERID system,PASSWORD "calvin"
  RMTHOST 192.168.130.171,MGRPORT 7809  ##目标库host
  RMTTASK REPLICAT,GROUP RINIKK
  TABLE ogguser.TCUSTMER;
  TABLE ogguser.TCUSTORD;
  ~
  GGSCI (dd1) 10> info extract *,tasks
 
  EXTRACT    EINIKK    Initialized  2013-04-16 11:36  Status STOPPED
  Checkpoint Lag      Not Available
  Log Read Checkpoint  Not Available
                        First Record        Record 0
  Task                SOURCEISTABLE
 
  目标库添加replicat组任务和参数文件:
  [oracle@kf2 ogg11]$ ggsci
 
  Oracle GoldenGate Command Interpreter for Oracle
  Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46
 
  Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 
 
 
  GGSCI (kf2.calvin) 1> add replicat rinikk,specialrun
  REPLICAT added.
 
 
  GGSCI (kf2.calvin) 2> edit params rinikk
 
 
  --
  -- GoldGate Initial Load Delivery
  --
  replicat rinikk
  assumetargetdefs
  userid system,password calvin
  discardfile ./dirrpt/rinikk.dsc,purge
  map ogguser.*, target ogguser.*;  --target 和前面的','间必须有一个空格
  ~
  GGSCI (kf2.calvin) 3> info replicat *,task
 
  REPLICAT  RINIKK    Initialized  2013-04-16 11:45  Status STOPPED
  Checkpoint Lag      00:00:00 (updated 00:02:52 ago)
  Log Read Checkpoint  Not Available
  Task                SPECIALRUN
 
  源库启动extract:
  GGSCI (dd1) 11> start extract einikk
 
  Sending START request to MANAGER ...
  EXTRACT EINIKK starting
 
  看到extract日志有下面内容,说明成功:
  GGSCI (dd1) 20> view report einikk
  ...
  Output to RINIKK:
 
  From Table OGGUSER.TCUSTMER:
          #                  inserts:        2
          #                  updates:        0
          #                  deletes:        0
          #                  discards:        0
  From Table OGGUSER.TCUSTORD:
          #                  inserts:        2
          #                  updates:        0
          #                  deletes:        0
          #                  discards:        0
  ...
 
  目标库查看replicat日志:
  GGSCI (kf2.calvin) 2> view report rinikk
  ...
  Report at 2013-04-16 13:51:08 (activity since 2013-04-16 13:51:02)
 
  From Table OGGUSER.TCUSTMER to OGGUSER.TCUSTMER:
          #                  inserts:        2
          #                  updates:        0
          #                  deletes:        0
          #                  discards:        0
  From Table OGGUSER.TCUSTORD to OGGUSER.TCUSTORD:
          #                  inserts:        2
          #                  updates:        0
          #                  deletes:        0
          #                  discards:        0
  ...
 
 
  检查目标库数据记录是否已经同步:
  [oracle@kf2 ogg11]$ sqlplus ogguser/ogguser
 
  SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 13:55:30 2013
 
  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
 
 
  Connected to:
  Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
  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
 
 
 
8. 配置DML方式
 
  源库添加extract组和参数文件:
  [oracle@dd1 ogg11]$ ggsci
 
  Oracle GoldenGate Command Interpreter for Oracle
  Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46
 
  Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 
 
 
  GGSCI (dd1) 1> add extract eorakk,tranlog,begin now,threads 1
  EXTRACT added.
 
 
  GGSCI (dd1) 2> info extract *
 
  EXTRACT    EORAKK    Initialized  2013-04-16 13:54  Status STOPPED
  Checkpoint Lag      00:00:00 (updated 00:00:11 ago)
  Log Read Checkpoint  Oracle Redo Logs
                        2013-04-16 13:54:23  Thread 1, Seqno 0, RBA 0
 
 
  GGSCI (dd1) 3> edit params eorakk
 
 
  EXTRACT EORAKK
  USERID system, PASSWORD "calvin"
  RMTHOST 192.168.130.171, MGRPORT 7809 ##目标库host
  RMTTRAIL ./dirdat/kk
  TABLE ogguser.TCUSTMER;
  TABLE ogguser.TCUSTORD;
 
 
  在源库添加remottrail并启动extract:
  GGSCI (dd1) 4> ADD RMTTRAIL ./dirdat/kk, EXTRACT EORAKK, MEGABYTES 5
  RMTTRAIL added.
 
 
  GGSCI (dd1) 5> INFO RMTTRAIL *
 
        Extract Trail: ./dirdat/kk
                Extract: EORAKK
                  Seqno: 0
                    RBA: 0
              File Size: 5M
 
 
 
  GGSCI (dd1) 6> start extract eorakk
 
  Sending START request to MANAGER ...
  EXTRACT EORAKK starting
 
 
  GGSCI (dd1) 7>
 
 
  在目标库配置全局参数文件:
  [oracle@kf2 ogg11]$ ggsci
 
  Oracle GoldenGate Command Interpreter for Oracle
  Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  Linux, x64, 64bit (optimized), Oracle 11g on Oct  4 2011 23:49:46
 
  Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 
 
 
  GGSCI (kf2.calvin) 1> edit params ./GLOBALS
 
 
  CHECKPOINTTABLE system.ggchkptable
 
  添加checkpoint:
  GGSCI (kf2.calvin) 6> add checkpointtable
  ERROR: Missing checkpoint table specification  ##报错提示没有指定checkpoint表
 
  GGSCI (kf2.calvin) 7> add checkpointtable system.ggchkptable
 
  Successfully created checkpoint table SYSTEM.GGCHKPTABLE.
 
  添加replicate组和参数文件:
  GGSCI (kf2.calvin) 10> add replicat rorakk, exttrail ./dirdat/kk, checkpointtable SYSTEM.GGCHKPTABLE
  REPLICAT added.
 
 
  GGSCI (kf2.calvin) 11> edit params rorakk
 
 
  REPLICAT RORAKK
  USERID system, PASSWORD calvin
  HANDLECOLLISIONS
  ASSUMETARGETDEFS
  DISCARDFILE ./dirrpt/RORAKK.DSC, PURGE
  MAP  ogguser.TCUSTMER, TARGET ogguser.TCUSTMER;
  MAP  ogguser.TCUSTORD, TARGET ogguser.TCUSTORD;
 
  启动replicat:
  GGSCI (kf2.calvin) 3> start replicat rorakk
  Sending START request to MANAGER ...
  REPLICAT RORAKK starting
 
  查看replicat报告:
  GGSCI (kf2.calvin) 4> view report rorakk
  ...
  Opened trail file ./dirdat/kk000000 at 2013-04-16 14:27:04  ##看到这句说明成功

9. 测试DML数据记录同步情况
  源库插入测试数据记录:
  SQL> insert into tcustord values('CALV',to_date('2013/04/16','yyyy/mm/dd'),'CHR',111,'100011',5,6);
 
  1 row created.
 
  SQL> commit;
 
  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
  CALV 16-APR-13 CHR            111        100011              5              6
 
 
  SQL> insert into tcustmer values('1001','CALV','SHANGHAI','SH');
 
  1 row created.
 
  SQL> commit;
 
  Commit complete.
 
  SQL> select * from tcustmer;
 
  CUST NAME                          CITY                ST
  ---- ------------------------------ -------------------- --
  WILL BG SOFTWARE CO.                SEATTLE              WA
  JANE ROCKY FLYER INC.              DENVER              CO
  1001 CALV                          SHANGHAI            SH
 
  目标库查看数据记录是否同步:
  [Oracle@kf2 ogg11]$ sqlplus ogguser/ogguser
 
  SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 16 14:39:46 2013
 
  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
 
 
  Connected to:
  Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
  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
  CALV 16-APR-13 CHR            111        100011              5              6 ##已同步
 
  SQL> select * from tcustmer;
 
  CUST NAME                          CITY                ST
  ---- ------------------------------ -------------------- --
  WILL BG SOFTWARE CO.                SEATTLE              WA
  JANE ROCKY FLYER INC.              DENVER              CO
  1001 CALV                          SHANGHAI            SH  ##已同步
 
 
  源库删除数据记录测试:
  SQL> delete from tcustord where order_id='111';
 
  1 row deleted.
 
  SQL> commit;
 
  Commit complete.
 
  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> delete from tcustmer where CUST_CODE='1001';
 
  1 row deleted.
 
  SQL> commit;
 
  Commit complete.
 
  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
 
  SQL> select * from tcustmer;
 
  CUST NAME                          CITY                ST
  ---- ------------------------------ -------------------- --
  WILL BG SOFTWARE CO.                SEATTLE              WA
  JANE ROCKY FLYER INC.              DENVER              CO

  至此,GoldenGate单向表DML同步实验完成。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9034054/viewspace-1973438/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-02-18

  • 博文量
    290
  • 访问量
    1049875