OGG实现跨版本的同步

OGG实现跨版本的同步

如果源端为低版本的OGG,目标端为高版本的OGG,由于向下兼容,不需要做额外的配置就可以完成同步。
如果源端为高版本的OGG,目标端为低版本的OGG,则需咋在源端的抽取进程中添加format release +目标端OGG版本号(如果源端OGG版本为19.1,则目标端OGG版本必须为OGG12.3及以上)

测试

环境:

源端192.168.1.12
oracle 19.3.0.0.0 PDB::orclpdb
OGG 19.1.0.0.4
目标端192.168.1.230
oracle 11.2.0.4.0 - 64bit Production SID:orcl
OGG 12.3.0.1.4

源端数据库配置

[oracle@du002 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 25 21:22:47 2019
Version 19.3.0.0.0

Copyright © 1982, 2019, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

1) 开启归档
如未开启,重新开启需要重启实例,在mount状态下
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /opt/oracle/db/dbs/arch
Oldest online log sequence 5
Next log sequence to archive 7
Current log sequence 7

2) 开启Force logging
SQL> ALTER DATABASE FORCE LOGGING;
Database altered.

3) 开启supplemental logging
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
Database altered.

4)核查是否开启
SQL> SELECT supplemental_log_data_min, force_logging, LOG_MODE FROM v$database;
SUPPLEMENTAL_LOG_DATA_MIN FORCE_LOGGING LOG_MODE


YES YES ARCHIVELOG

5)设置数据库GoldenGate参数

SQL> alter system set enable_goldengate_replication=true scope=both;
System altered.

6)创建OGG用户及赋权
SQL> create user c##ggadm identified by goldengate123;
User created.
SQL> grant dba to c##ggadm;
Grant succeeded.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED


     2 PDB$SEED                       READ ONLY  NO
     3 ORCLPDB                        MOUNTED

SQL> alter session set container=ORCLPDB;
Session altered.

SQL> alter database open;
Database altered.

SQL> create tablespace ogg_tbs datafile ‘/data/oracle/orcl/orclpdb/ogg_tbs01.dbf’ size 5G AUTOEXTEND on;
Tablespace created.

SQL> create user ggadm identified by goldengate123 default tablespace ogg_tbs quota unlimited on ogg_tbs;
User created.

SQL> grant connect, resource,CREATE SESSION to ggadm;
Grant succeeded.

SQL> exec dbms_goldengate_auth.grant_admin_privilege(‘ggadm’);
PL/SQL procedure successfully completed.

SQL> exec dbms_goldengate_auth.grant_admin_privilege(grantee=>‘ggadm’);
PL/SQL procedure successfully completed.

SQL> grant SELECT ANY TABLE to ggadm;
Grant succeeded.

SQL> grant select any dictionary to ggadm;
Grant succeeded.

SQL> grant SELECT ANY TRANSACTION to ggadm;
Grant succeeded.

SQL> commit;
Commit complete.

7)打开数据库侦听器
[oracle@du002 ~]$ lsnrctl status

8)户及测试表
[oracle@du002 ~]$ sqlplus / as sysdba
SQL> create user scott identified by tiger;
User created.

SQL> grant dba to scott;
Grant succeeded.

SQL> commit;
Commit complete.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@du002 ~]$ sqlplus scott/[email protected]:1521/orclpdb

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 25 21:42:34 2019
Version 19.3.0.0.0

Copyright © 1982, 2019, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> create table t(id int primary key,info varchar2(20));
Table created.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@du002 ~]$

源端安装配置OGG

[root@du002 ~]# yum -y install binutils* compat-libcap1* compat-libstdc++*.x86_64 compat-libstdc++*.i686 gcc* gcc-c++* libgcc-*.x86_64 libgcc-*.i686 libstdc++-*.x86_64 libstdc++-*.i686 libaio-*.x86_64 libaio-*.i686 make* sysstat glibc-*.x86_64 glibc-*.i686 elfutils-* unixODBC*

[root@du002 ~]# su - oracle
[oracle@du002 ~]$ unzip 191004_fbo_ggs_Linux_x64_shiphome.zip
[oracle@du002 ~]$ 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/.local/bin:$HOME/bin
export PATH
ORACLE_BASE=/opt/oracle;export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/db;export ORACLE_HOME
ORACLE_SID=orcl;export ORACLE_SID
export GG_HOME=/home/oracle/ogg
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin;export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GG_HOME:$ORACLE_HOME/lib:/usr/lib;export LD_LIBRARY_PATH
LANG=en_US;export LANG
alias sqlplus='rlwrap sqlplus'

if [ $USER = "oracle" ];then
 if [ $SHELL = "/bin/ksh" ];then
     ulimit -p 16384
     ulimit -n 65536
   else
    ulimit -u 16384 -n 65536
 fi
fi


[oracle@du002 ~]$ source .bash_profile

[oracle@du002 ~]$ cp /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/response/oggcore.rsp /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/oggcore.rsp
[oracle@du002 ~]$ vim /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/oggcore.rsp
INSTALL_OPTION=ORA19c
SOFTWARE_LOCATION=/home/oracle/ogg

***Specify ORA19c for installing Oracle GoldenGate for Oracle Database 19c or # ORA18c for installing Oracle GoldenGate for Oracle Database 18c or # ORA12c for installing Oracle GoldenGate for Oracle Database 12c or # ORA11g for installing Oracle GoldenGate for Oracle Database 11g ***

[oracle@du002 ~]$ /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/runInstaller -silent -nowait -responseFile /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/oggcore.rsp
Starting Oracle Universal Installer…
Checking Temp space: must be greater than 120 MB. Actual 7976 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4087 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-11-26_09-44-04PM. Please wait …[oracle@du002 ~]$ You can find the log of this install session at:
/opt/oraInventory/logs/installActions2019-11-26_09-44-04PM.log
Successfully Setup Software.
The installation of Oracle GoldenGate Core was successful.
Please check ‘/opt/oraInventory/logs/silentInstall2019-11-26_09-44-04PM.log’ for more details.
[oracle@du002 ~]$
[oracle@du002 ~]$ cd /home/oracle/ogg
[oracle@du002 ogg]$ ldd ggsci
linux-vdso.so.1 => (0x00007ffc83fe0000)
librt.so.1 => /lib64/librt.so.1 (0x00007f70ca7a9000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f70ca5a4000)
libgglog.so => /home/oracle/ogg/./libgglog.so (0x00007f70ca23e000)
libggutil.so => /home/oracle/ogg/./libggutil.so (0x00007f70ca022000)
libggrepo.so => /home/oracle/ogg/./libggrepo.so (0x00007f70c9d67000)
libdb-6.1.so => /home/oracle/ogg/./libdb-6.1.so (0x00007f70c9951000)
liblmdb.so => /home/oracle/ogg/./liblmdb.so (0x00007f70c973c000)
libggperf.so => /home/oracle/ogg/./libggperf.so (0x00007f70c9509000)
libggparam.so => /home/oracle/ogg/./libggparam.so (0x00007f70c7df0000)
libicui18n.so.62 => /home/oracle/ogg/./libicui18n.so.62 (0x00007f70c790b000)
libicuuc.so.62 => /home/oracle/ogg/./libicuuc.so.62 (0x00007f70c7509000)
libicudata.so.62 => /home/oracle/ogg/./libicudata.so.62 (0x00007f70c54f1000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f70c52d5000)
libxerces-c-3.2.so => /home/oracle/ogg/./libxerces-c-3.2.so (0x00007f70c4c60000)
libantlr3c.so => /home/oracle/ogg/./libantlr3c.so (0x00007f70c4a45000)
libnnz19.so => /opt/oracle/db/lib/libnnz19.so (0x00007f70c42fd000)
libclntsh.so.19.1 => /opt/oracle/db/lib/libclntsh.so.19.1 (0x00007f70c02ee000)
libclntshcore.so.19.1 => /opt/oracle/db/lib/libclntshcore.so.19.1 (0x00007f70bfd4e000)
libggnnzitp.so => /home/oracle/ogg/./libggnnzitp.so (0x00007f70bf237000)
libstdc++.so.6 => /home/oracle/ogg/./libstdc++.so.6 (0x00007f70bee9f000)
libm.so.6 => /lib64/libm.so.6 (0x00007f70beb9d000)
libgcc_s.so.1 => /home/oracle/ogg/./libgcc_s.so.1 (0x00007f70be987000)
libc.so.6 => /lib64/libc.so.6 (0x00007f70be5b8000)
/lib64/ld-linux-x86-64.so.2 (0x0000559c27ad8000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f70be39d000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007f70be19b000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f70bdf82000)
[oracle@du002 ogg]$

[oracle@du002 ogg]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 19.1.0.0.4 OGGCORE_19.1.0.0.0_PLATFORMS_191017.1054_FBO
Linux, x64, 64bit (optimized), Oracle 19c on Oct 17 2019 21:16:29
Operating system character set identified as US-ASCII.

Copyright © 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (du002.qiankun.com) 1> create subdirs
Creating subdirectories under current directory /home/oracle/ogg
Parameter file /home/oracle/ogg/dirprm: created.
Report file /home/oracle/ogg/dirrpt: created.
Checkpoint file /home/oracle/ogg/dirchk: created.
Process status files /home/oracle/ogg/dirpcs: created.
SQL script files /home/oracle/ogg/dirsql: created.
Database definitions files /home/oracle/ogg/dirdef: created.
Extract data files /home/oracle/ogg/dirdat: created.
Temporary files /home/oracle/ogg/dirtmp: created.
Credential store files /home/oracle/ogg/dircrd: created.
Masterkey wallet files /home/oracle/ogg/dirwlt: created.
Dump files /home/oracle/ogg/dirdmp: created.

GGSCI (du002.qiankun.com) 2> show
Parameter settings:
SET DEBUG OFF
Current directory: /home/oracle/ogg
Editor: vi
Reports (.rpt) /home/oracle/ogg/dirrpt
Parameters (.prm) /home/oracle/ogg/dirprm
Replicat Checkpoints (.cpr) /home/oracle/ogg/dirchk
Extract Checkpoints (.cpe) /home/oracle/ogg/dirchk
Process Status (.pcs) /home/oracle/ogg/dirpcs
SQL Scripts (.sql) /home/oracle/ogg/dirsql
Database Definitions (.def) /home/oracle/ogg/dirdef
Dump files (.dmp) /home/oracle/ogg/dirdmp
Masterkey wallet files (.wlt) /home/oracle/ogg/dirwlt
Credential store files (.crd) /home/oracle/ogg/dircrd

GGSCI (du002.qiankun.com) 5> view param mgr
PORT 7809
DYNAMICPORTLIST 7810-7820

GGSCI (du002.qiankun.com) 7> start mgr
Manager started.

GGSCI (du002.qiankun.com) 8> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING

GGSCI (du002.qiankun.com) 9> exit
[oracle@du002 ogg]$

目标端数据库配置

[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 7 19:14:40 2019
Copyright © 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL>

1) 开启归档,–如未开启,重新开启需要重启实例,在mount状态下
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/app/oracle/db/dbs/arch
Oldest online log sequence 37
Next log sequence to archive 39
Current log sequence 39
SQL>

2) 开启Force logging
SQL> alter database force logging;
Database altered.
SQL>

3) 开启supplemental logging
SQL> alter database add supplemental log data;
Database altered.
SQL>

4) 设置数据库GoldenGate参数
SQL> show parameter enable_goldengate_replication;
NAME TYPE VALUE


enable_goldengate_replication boolean FALSE
SQL> alter system set enable_goldengate_replication=true scope=both;
System altered.
SQL>

5) 创建OGG表空间
SQL> create tablespace ogg_tbs datafile ‘+DATA/orcl/datafile/ogg_tbs_01.dbf’ size 5G AUTOEXTEND on;
Tablespace created.
SQL>
–如要启用DDL功能,OGG用户需要独立的表空间。

6) 创建OGG账号
SQL> create user ggadm identified by goldengate123 default tablespace ogg_tbs;
User created.
SQL>

7) 给OGG账号赋权
–源端:无DDL,不使用DBA权限的情况: —For 集成模式,db 11.2.0.4.0
–The following privileges apply to Oracle versions 11.2.0.4 or later.
–源端:Extract Classic Mode :
SQL>grant connect, resource,CREATE SESSION to ggadm;
SQL>exec dbms_goldengate_auth.grant_admin_privilege(‘ggadm’);
SQL>exec dbms_goldengate_auth.grant_admin_privilege(grantee=>‘ggadm’);
SQL>grant select any dictionary to ggadm;
SQL>grant SELECT ANY TABLE to ggadm;
SQL>grant SELECT ANY TRANSACTION to ggadm;
SQL>grant dba to ggadm;
SQL>commit;

8) 配置tnsnames.ora

[oracle@oracle ~]$ cat $ORACLE_HOME/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/app/oracle/db/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle.qiankun.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
[oracle@oracle ~]$

9) 检测tnsping 和相关网络是否联通
[oracle@oracle ~]$ tnsping orcl
[oracle@oracle ~]$ sqlplus ggadm/goldengate123@orcl

  1. 创建测试用户及测试表
    SQL> create user vic identified by vic;
    User created.

SQL> grant dba to vic;
Grant succeeded.

SQL> commit;
Commit complete.
SQL>

SQL> conn vic/vic
Connected.

SQL> create table t(id int primary key,info varchar2(20));
Table created.
SQL> exit

目标端安装配置OGG

[root@oracle ~]# yum -y install binutils* compat-libcap1* compat-libstdc++*.x86_64 compat-libstdc++*.i686 gcc* gcc-c++* libgcc-*.x86_64 libgcc-*.i686 libstdc++-*.x86_64 libstdc++-*.i686 libaio-*.x86_64 libaio-*.i686 make* sysstat glibc-*.x86_64 glibc-*.i686 elfutils-* unixODBC*

[root@oracle ~]# mv 123014_fbo_ggs_Linux_x64_shiphome.zip /home/oracle
[root@oracle ~]# chown oracle:oinstall /home/oracle/123014_fbo_ggs_Linux_x64_shiphome.zip

[root@oracle ~]# su - oracle
[oracle@oracle ~]$ unzip /home/oracle/123014_fbo_ggs_Linux_x64_shiphome.zip

[oracle@oracle ~]$ 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
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=/oracle/app/oracle/db; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
export GG_HOME=/home/oracle/ogg
PATH=${PATH}:$HOME/bin:$ORACLE_HOME/bin:$GG_HOME
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GG_HOME:$ORACLE_HOME/lib:/lib:/usr/lib
export PATH
alias sqlplus='rlwrap sqlplus'

[oracle@oracle ~]$ source .bash_profile

[oracle@oracle ~]$ cp /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/response/oggcore.rsp /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/oggcore.rsp
[oracle@oracle ~]$ vim /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/oggcore.rsp
INSTALL_OPTION=ORA11g
SOFTWARE_LOCATION=/home/oracle/ogg

INSTALL_OPTION-11g数据库选择ORA11g,12C选择ORA12c
[oracle@oracle ~]$ /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/runInstaller -silent -nowait -responseFile /home/oracle/fbo_ggs_Linux_x64_shiphome/Disk1/oggcore.rsp
Starting Oracle Universal Installer…
Checking Temp space: must be greater than 120 MB. Actual 4629 MB Passed
Checking swap space: must be greater than 150 MB. Actual 5117 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-11-07_07-30-20PM. Please wait …[oracle@oracle ~]$ MobaXterm X11 proxy: Unsupported authorisation protocol
You can find the log of this install session at:
/oracle/app/oraInventory/logs/installActions2019-11-07_07-30-20PM.log
Please check ‘/oracle/app/oraInventory/logs/silentInstall2019-11-07_07-30-20PM.log’ for more details.
Successfully Setup Software.
[oracle@oracle ~]$

[oracle@oracle ~]$ cd /home/oracle/ogg
[oracle@oracle ogg]$ ldd ggsci
linux-vdso.so.1 => (0x00007fff83f4b000)
librt.so.1 => /lib64/librt.so.1 (0x0000003eb0a00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003eafe00000)
libgglog.so => /home/oracle/ogg/./libgglog.so (0x00007fb88eadb000)
libggutil.so => /home/oracle/ogg/./libggutil.so (0x00007fb88e8bc000)
libggrepo.so => /home/oracle/ogg/./libggrepo.so (0x00007fb88e5fb000)
libdb-6.1.so => /home/oracle/ogg/./libdb-6.1.so (0x00007fb88e1e5000)
liblmdb.so => /home/oracle/ogg/./liblmdb.so (0x00007fb88dfd0000)
libggperf.so => /home/oracle/ogg/./libggperf.so (0x00007fb88dd98000)
libggparam.so => /home/oracle/ogg/./libggparam.so (0x00007fb88c695000)
libicui18n.so.56 => /home/oracle/ogg/./libicui18n.so.56 (0x00007fb88c1cf000)
libicuuc.so.56 => /home/oracle/ogg/./libicuuc.so.56 (0x00007fb88bdd3000)
libicudata.so.56 => /home/oracle/ogg/./libicudata.so.56 (0x00007fb889f70000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003eb0600000)
libxerces-c-3.1.so => /home/oracle/ogg/./libxerces-c-3.1.so (0x00007fb8898e0000)
libantlr3c.so => /home/oracle/ogg/./libantlr3c.so (0x00007fb8896c7000)
libnnz11.so => /oracle/app/oracle/db/lib/libnnz11.so (0x00007fb8892fa000)
libclntsh.so.11.1 => /oracle/app/oracle/db/lib/libclntsh.so.11.1 (0x00007fb88688f000)
libggnnzitp.so => /home/oracle/ogg/./libggnnzitp.so (0x00007fb885e1b000)
libm.so.6 => /lib64/libm.so.6 (0x0000003eb0e00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003eb0200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003eafa00000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003ec4800000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003eb6e00000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007fb885c18000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003eb4e00000)
[oracle@oracle ogg]$

[oracle@oracle ogg]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.3.0.1.4 OGGCORE_12.3.0.1.0_PLATFORMS_180415.0359_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 15 2018 21:16:09
Operating system character set identified as UTF-8.

Copyright © 1995, 2018, Oracle and/or its affiliates. All rights reserved.

GGSCI (oracle.qiankun.com) 1> create subdirs
Creating subdirectories under current directory /home/oracle/ogg
Parameter file /home/oracle/ogg/dirprm: created.
Report file /home/oracle/ogg/dirrpt: created.
Checkpoint file /home/oracle/ogg/dirchk: created.
Process status files /home/oracle/ogg/dirpcs: created.
SQL script files /home/oracle/ogg/dirsql: created.
Database definitions files /home/oracle/ogg/dirdef: created.
Extract data files /home/oracle/ogg/dirdat: created.
Temporary files /home/oracle/ogg/dirtmp: created.
Credential store files /home/oracle/ogg/dircrd: created.
Masterkey wallet files /home/oracle/ogg/dirwlt: created.
Dump files /home/oracle/ogg/dirdmp: created.

GGSCI (oracle.qiankun.com) 2> show
Parameter settings:
SET DEBUG OFF
Current directory: /home/oracle/ogg
Editor: vi
Reports (.rpt) /home/oracle/ogg/dirrpt
Parameters (.prm) /home/oracle/ogg/dirprm
Replicat Checkpoints (.cpr) /home/oracle/ogg/dirchk
Extract Checkpoints (.cpe) /home/oracle/ogg/dirchk
Process Status (.pcs) /home/oracle/ogg/dirpcs
SQL Scripts (.sql) /home/oracle/ogg/dirsql
Database Definitions (.def) /home/oracle/ogg/dirdef
Dump files (.dmp) /home/oracle/ogg/dirdmp
Masterkey wallet files (.wlt) /home/oracle/ogg/dirwlt
Credential store files (.crd) /home/oracle/ogg/dircrd

GGSCI (oracle.qiankun.com) 6> view param mgr
PORT 7809
DYNAMICPORTLIST 7810-7820

GGSCI (oracle.qiankun.com) 7> start mgr
Manager started.

GGSCI (oracle.qiankun.com) 1> exit
[oracle@oracle ogg]$

源端配置进程

[oracle@du002 ~]$ /home/oracle/ogg/ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 19.1.0.0.4 OGGCORE_19.1.0.0.0_PLATFORMS_191017.1054_FBO
Linux, x64, 64bit (optimized), Oracle 19c on Oct 17 2019 21:16:29
Operating system character set identified as US-ASCII.
Copyright © 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (du002.qiankun.com) 1> dblogin userid [email protected]:1521/orclpdb,password goldengate123
Successfully logged into database ORCLPDB.

GGSCI (du002.qiankun.com as ggadm@orcl/ORCLPDB) 2> add trandata ORCLPDB.SCOTT.T
2019-11-29 15:59:20 INFO OGG-15132 Logging of supplemental redo data enabled for table ORCLPDB.SCOTT.T.
2019-11-29 15:59:20 INFO OGG-15133 TRANDATA for scheduling columns has been added on table ORCLPDB.SCOTT.T.
2019-11-29 15:59:20 INFO OGG-15135 TRANDATA for instantiation CSN has been added on table ORCLPDB.SCOTT.T.
2019-11-29 15:59:23 INFO OGG-10471 ***** Oracle Goldengate support information on table SCOTT.T *****
Oracle Goldengate support native capture on table SCOTT.T.
Oracle Goldengate marked following column as key columns on table SCOTT.T: ID.

GGSCI (du002.qiankun.com as ggadm@orcl/ORCLPDB) 6> dblogin userid c##[email protected]:1521/orcl,password goldengate123
Successfully logged into database CDB$ROOT.

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 7> register extract myext database container(ORCLPDB)
2019-11-29 16:11:50 INFO OGG-02003 Extract MYEXT successfully registered with database at SCN 2216803.

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 8> add extract myext, integrated tranlog, begin now
EXTRACT (Integrated) added.

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 9> add exttrail /home/oracle/ogg/dirdat/tt,extract myext,megabytes 10
EXTTRAIL added.

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 11> view param MYEXT
EXTRACT MYEXT
dynamicresolution
userid c##[email protected]:1521/orcl,password goldengate123
setenv(ORACLE_SID=ORCL)
exttrail /home/oracle/ogg/dirdat/tt,format release 12.3
SOURCECATALOG ORCLPDB
table ORCLPDB.SCOTT.T;

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 12> add extract mydp, exttrailsource /home/oracle/ogg/dirdat/tt, begin now
EXTRACT added.

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 13> ADD RMTTRAIL /home/oracle/ogg/dirdat/tt, EXTRACT mydp
RMTTRAIL added.

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 16> view param mydp
EXTRACT mydp
PASSTHRU
RMTHOST 192.168.1.230, MGRPORT 7809
RMTTRAIL /home/oracle/ogg/dirdat/tt
TABLE ORCLPDB.SCOTT.T;

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 18> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED MYDP 00:00:00 00:03:14
EXTRACT STOPPED MYEXT 00:00:00 00:08:07

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 19> start *
Sending START request to MANAGER …
EXTRACT MYDP starting
Sending START request to MANAGER …
EXTRACT MYEXT starting

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 20> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING MYDP 00:00:00 00:00:02
EXTRACT RUNNING MYEXT 00:00:00 00:13:13

GGSCI (du002.qiankun.com as c##ggadm@orcl/CDB$ROOT) 21>

目标端配置进程

[oracle@du001 ~]$ /home/oracle/ogg/ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.3.0.1.4 OGGCORE_12.3.0.1.0_PLATFORMS_180415.0359_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Apr 16 2018 00:53:30
Operating system character set identified as US-ASCII.
Copyright © 1995, 2018, Oracle and/or its affiliates. All rights reserved.

GGSCI (du001.qiankun.com) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING

GGSCI (du001.qiankun.com) 2> edit params ./GLOBALS
checkpointtable ggadm.chktab

GGSCI (oracle.qiankun.com) 3> dblogin userid [email protected]:1521/orcl,password goldengate123
Successfully logged into database.

GGSCI (oracle.qiankun.com as ggadm@orcl) 4> add checkpointtable ggadm.chktab
Successfully created checkpoint table ggadm.chktab.

GGSCI (oracle.qiankun.com as ggadm@orcl) 5> add replicat myrep, exttrail /home/oracle/ogg/dirdat/tt,begin now, checkpointtable ggadm.chktab
REPLICAT added.

GGSCI (oracle.qiankun.com as ggadm@orcl) 6> edit params myrep
REPLICAT myrep
SETENV(ORACLE_SID=ORCLPDB)
USERID [email protected]:1521/orcl,password goldengate123
ALLOWNOOPUPDATES
ASSUMETARGETDEFS
MAP ORCLPDB.SCOTT.T, TARGET VIC.T;

GGSCI (oracle.qiankun.com as ggadm@orcl) 7> start myrep
Sending START request to MANAGER …
REPLICAT MYREP starting

GGSCI (oracle.qiankun.com as ggadm@orcl) 9> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING MYREP 00:00:00 00:00:00

GGSCI (oracle.qiankun.com as ggadm@orcl) 10>

测试数据

源端:
[oracle@du002 ~]$ sqlplus scott/[email protected]:1521/orclpdb
SQL> select * from t;
no rows selected

SQL> insert into t values (1,‘duqk’);
1 row created.

SQL> commit;
Commit complete.

SQL> select * from t;
ID INFO


     1 duqk

SQL>

目标端:
[oracle@oracle ~]$ sqlplus vic/vic
SQL> select * from t;
ID INFO


     1 duqk

SQL>

你可能感兴趣的:(ORACLE,OGG,oracle19c,pdb,集成模式,OGG跨版本同步)