[2021-01-06] Oracle19C RAC 搭建OGG聚合模式同步数据到11.2.0.4详细记录

环境说明
源端19.7 RAC  OGG版本19.1
node1: 192.168.40.160
node2: 192.168.40.161

RAC安装OGG使用的是ACFS方式,ACFS搭建可以参考:
https://blog.csdn.net/m15217321304/article/details/112236321

19.1OGG在19.7RAC上面安装可以参考:

https://blog.csdn.net/m15217321304/article/details/112245469

目标端11.2.0.4单实例 OGG版本12.1(12.1搭建会有兼容问题,最后把12.1升级为19.1)
IP:192.168.40.170
 

--//此次搭建过程为抽取源端的PDB1的数据

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jan 5 17:15:12 2021
Version 19.7.0.0.0

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


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

SQL> 

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO
         4 PDB2                           READ WRITE NO
SQL> 

--//在pdb1创建被抽取的用户pg

SQL> alter session set container =PDB1;

Session altered.

SQL> 
SQL> create user pg identified by postgres;

User created.

SQL> show user
USER is "SYS"
SQL> grant resource,connect to pg;

Grant succeeded.

SQL> 

--//使用pg用户创建两张测试表T1、T2

SQL> show user
USER is "PG"
SQL> create table t1(id int);

Table created.

SQL> create table t2(id int, name varchar2(20));

Table created.

SQL> 

--//修改tns文件,通过tns可以直接连接pdb1的pg用户,tnsnames.ora文件添加如下内容

PDB1=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dm-scan)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = pdb1)
    )
  )

--//连接测试

[oracle@dm01 admin]$ sqlplus pg/postgres@PDB1

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jan 5 17:34:51 2021
Version 19.7.0.0.0

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


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

SQL> 

--//创建goldengate数据库用户(源和目标)
create user goldengate identified by goldengate;
grant connect,resource to goldengate;
grant execute on utl_file to goldengate;

--//便于测试赋予DBA权限
grant dba to goldengate;


SQL> alter session set container=PDB1;

Session altered.

SQL> create user goldengate identified by goldengate;

User created.

SQL> grant connect,resource to goldengate;

Grant succeeded.

SQL> grant execute on utl_file to goldengate;

Grant succeeded.

SQL> grant dba to goldengate;

Grant succeeded.

SQL> 

--//源端配置MGR,参数文件如下:

PORT 7809
DYNAMICPORTLIST 7800-7900
AUTORESTART EXTRACT *, RETRIES 5, WAITMINUTES 2, RESETMINUTES 60
PURGEOLDEXTRACTS /ogg/ogg/trails/w1*, USECHECKPOINTS, MINKEEPFILES 10
PURGEDDLHISTORY MINKEEPDAYS 3, MAXKEEPDAYS 5, FREQUENCYMINUTES 30
PURGEMARKERHISTORY MINKEEPDAYS 3, MAXKEEPDAYS 5, FREQUENCYMINUTES 30
lagreporthours 1
laginfominutes 30
lagcriticalminutes 45

--//注册logminer server DB

GGSCI (dm01 as goldengate@qxy1/PDB1) 11> dblogin userid goldengate@PDB1 password goldengate


GGSCI (dm01 as goldengate@qxy1/PDB1) 12> register extract exint database

2021-01-06 10:40:20  ERROR   OGG-08223  ERROR: One or more containers must be specified when registering Extract for a container database.


GGSCI (dm01 as goldengate@qxy1/PDB1) 13> 

参考MOS
ERROR: One Or More Containers Must Be Specified When Registering Extract For A Container Database. (Doc ID 2453732.1)

--//报错的意思就是需要创建一个全局用户,就是c##开头的,跨所有PDB的

--//创建一个全局用户

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> create user c##goldengate identified by goldengate;

User created.

SQL> exec dbms_goldengate_auth.grant_admin_privilege('C##GOLDENGATE',container=>'all');

PL/SQL procedure successfully completed.

SQL> 
SQL> grant connect, resource to c##goldengate container=all;

Grant succeeded.

SQL> 

--//赋值权限的时候,如果不加container=all,连接测试会提示ORA-01045: user C##GOLDENGATE lacks CREATE SESSION privilege; logon denied
 

--//测试连接PDB1

[oracle@dm01 ogg]$ sqlplus c##goldengate/goldengate@PDB1

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 6 10:47:33 2021
Version 19.7.0.0.0

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


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

SQL> 

--//ggsci上面测试

[oracle@dm01 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 UTF-8.

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



GGSCI (dm01) 1> dblogin userid goldengate@PDB1 password goldengate
Successfully logged into database PDB1.

GGSCI (dm01 as goldengate@qxy2/PDB1) 2> 

--//再次注册抽取进程

GGSCI (dm01) 3> dblogin userid c##goldengate,password goldengate
Successfully logged into database CDB$ROOT.

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 5> REGISTER EXTRACT EXTORA DATABASE CONTAINER(PDB1)   

2021-01-06 11:14:22  ERROR   OGG-02060  The Oracle mining database is not configured properly to support integrated capture. The following configuration error must be fixed:  Operation not supported because enable_goldengate_replication is not set to true.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 6> 

--//上面这步操作的时候,注册的extract写的是EXTORA,下面会因为这步不一致导致了错误

--//设置enable_goldengate_replication为true

SQL> set lin 200
SQL> show parameter enable_goldengate_replication

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
enable_goldengate_replication        boolean                FALSE
SQL> 
SQL> alter system set enable_goldengate_replication=TRUE;

System altered.

--//再次注册提示表空间没有权限

GGSCI (dm01) 1> dblogin userid c##goldengate,password goldengate
Successfully logged into database CDB$ROOT.

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 2> REGISTER EXTRACT EXTORA DATABASE CONTAINER(PDB1)

2021-01-06 11:17:29  ERROR   OGG-08221  Cannot register or unregister EXTRACT EXTORA because of the following SQL error: OCI Error ORA (status = 1950-ORA-01950: no privileges on tablespace 'USERS'
ORA-06512: at "SYS.DBMS_STREAMS_ADM_IVK", line 766
ORA-06512: at "SYS.DBMS_AQADM", line 415
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3491
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 4059
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3103
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 327
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 135
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 227
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 286
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3074
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3801
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3469
ORA-06512: at "SYS.DBMS_AQADM", line 406
ORA-06512: at "SYS.DBMS_STREAMS_ADM_IVK", line 635
ORA-06512: at "SYS.DBMS_STREAMS_ADM", line 269
ORA-06512: at line 1
).

--//把users的表空间权限赋值给c##goldengate用户

//第一次授权报错
SQL> alter user c##goldengate quota unlimited on users;
alter user c##goldengate quota unlimited on users
*
ERROR at line 1:
ORA-65048: error encountered when processing the current DDL statement in
pluggable database PDB1
ORA-00959: tablespace 'USERS' does not exist


SQL> 
--//加上container再次设置
alter user c##goldengate quota unlimited on users container=current;


SQL> alter user c##goldengate quota unlimited on users container=current;

User altered.

SQL> 

解决参考:
ORA-65048 ORA-01918 error with Create User or Alter User in CDB (Doc ID 2105890.1)

--//再次注册成功


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 2> REGISTER EXTRACT EXTORA DATABASE CONTAINER(PDB1)

2021-01-06 11:25:00  INFO    OGG-02003  Extract EXTORA successfully registered with database at SCN 11788516.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 3> 

--//对应数据库alert日志如下

PDB1(3):Wed Jan 06 11:24:44 2021
PDB1(3):Logminer Bld: Build started
PDB1(3):Wed Jan 06 11:24:44 2021
PDB1(3):Logminer Bld: Lockdown Complete.  DB_TXN_SCN is 0 11788516 LockdownSCN is 11788516
2021-01-06T11:24:45.426903+08:00
PDB1(3):Wed Jan 06 11:24:45 2021
PDB1(3):Logminer Bld: Done
2021-01-06T11:24:45.427500+08:00
ALTER SYSTEM SWITCH ALL LOGFILE start (qxy1)
2021-01-06T11:24:52.972062+08:00
GoldenGate Capture OGG$CAP_EXTORA CAPTURE Created
2021-01-06T11:24:53.140285+08:00
GoldenGate CAPTURE OGG$CAP_EXTORA: Start SCN: 11788516 (0x00b3e0e4.00000000)
2021-01-06T11:24:53.140436+08:00
GoldenGate CAPTURE OGG$CAP_EXTORA: First SCN: 11788155 (0x00b3df7b.00000000)
2021-01-06T11:24:53.140506+08:00
GoldenGate CAPTURE OGG$CAP_EXTORA: Required Checkpoint SCN: 0 (0x00000000.00000000)
2021-01-06T11:24:53.140544+08:00
GoldenGate CAPTURE OGG$CAP_EXTORA: Captured SCN: 0 (0x00000000.00000000)
2021-01-06T11:24:53.140589+08:00
GoldenGate CAPTURE OGG$CAP_EXTORA: Applied SCN: 0 (0x00000000.00000000)
CAPTURE OGG$CAP_EXTORA: Capture Type: LOCAL
CAPTURE OGG$CAP_EXTORA: Logminer Id: 1
CAPTURE OGG$CAP_EXTORA: Source Database: PDB1
CAPTURE OGG$CAP_EXTORA: Source Root Name: QXY
2021-01-06T11:24:54.740208+08:00
Resize operation completed for file# 1, old size 1157120K, new size 1167360K
2021-01-06T11:24:55.487363+08:00
GoldenGate Apply: OGG$EXTORA APPLY Created
2021-01-06T11:24:56.749693+08:00
APPLY OGG$EXTORA: Apply User: C##GOLDENGATE
2021-01-06T11:24:56.749758+08:00
APPLY OGG$EXTORA: Apply Tag: 00
2021-01-06T11:24:57.904076+08:00
GoldenGate CAPTURE OGG$CAP_EXTORA:Setting XOUT_CLIENT_EXISTS to Y
2021-01-06T11:24:58.513969+08:00
GoldenGate CAPTURE CP01 for OGG$CAP_EXTORA started with pid=101, OS id=71774
2021-01-06T11:24:58.697817+08:00
Streams CAPTURE OGG$CAP_EXTORA: Start SCN: 11788516 (0x00b3e0e4.00000000)
2021-01-06T11:24:58.697867+08:00
Streams CAPTURE OGG$CAP_EXTORA: First SCN: 11788155 (0x00b3df7b.00000000)
2021-01-06T11:24:58.697992+08:00
Streams CAPTURE OGG$CAP_EXTORA: Required Checkpoint SCN: 0 (0x00000000.00000000)
2021-01-06T11:24:58.698066+08:00
Streams CAPTURE OGG$CAP_EXTORA: Captured SCN: 0 (0x00000000.00000000)
2021-01-06T11:24:58.698105+08:00
Streams CAPTURE OGG$CAP_EXTORA: Applied SCN: 0 (0x00000000.00000000)
CAPTURE OGG$CAP_EXTORA: Capture Type: LOCAL
CAPTURE OGG$CAP_EXTORA: Logminer Id: 1
CAPTURE OGG$CAP_EXTORA: Source Database: PDB1
CAPTURE OGG$CAP_EXTORA: Source Root Name: QXY

--//添加参数文件

add extract exint,integrated tranlog,begin now, threads 2 

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 4> add extract exint,integrated tranlog,begin now, threads 2 
ERROR: THREADS is not allowed for INTEGRATED extract.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 5> 

--//去掉threads
GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 7> add extract exint,integrated tranlog,begin now
EXTRACT (Integrated) added.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 8> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     STOPPED     EXINT       00:00:00      00:00:05    


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 9> 

--//编辑参数

edit params exint
extract exint
setenv (ORACLE_SID = "qxy1")
setenv (NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")
userid c##goldengate, password goldengate
TRANLOGOPTIONS INTEGRATEDPARAMS(parallelism 2)
TRANLOGOPTIONS GETCTASDML
DDL INCLUDE MAPPED
exttrail /ogg/ogg/trails/w1
discardfile /ogg/ogg/dirdat/exint.dsc, append, megabytes 100
getupdatebefores
nocompressdeletes
nocompressupdates
--LOGALLSUPCOLS
dboptions allowunusedcolumn
fetchoptions nousesnapshot
fetchoptions fetchpkupdatecols

table pg.*;

--//启动抽取进程失败

Source Context :
  SourceModule            : [ggapp.wildcard]
  SourceID                : [../gglib/ggapp/wildcard.c]
  SourceMethod            : [WILDCARD_get_entry]
  SourceLine              : [2229]
  ThreadBacktrace         : [12] elements
                          : [/ogg/ogg/libgglog.so(CMessageContext::AddThreadContext())]
                          : [/ogg/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...))]
                          : [/ogg/ogg/libgglog.so(_MSG_String_QualTableName(CSourceContext*, int, char const*, ggs::gglib::ggapp::CQu
alDBObjName<(DBObjType)1> const&, CMessageFactory::MessageDisposition))]
                          : [/ogg/ogg/extract()]

...skipping one line
                          : [/ogg/ogg/extract()]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::MainThread::ExecMain())]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::Threa
dArgs*))]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/ogg/ogg/extract(main)]
                          : [/lib64/libc.so.6(__libc_start_main)]
                          : [/ogg/ogg/extract()]

2021-01-06 12:37:36  ERROR   OGG-02636  The TABLE specification 'table pg.*' for the source table pg.* does not include a catalog nam
e. The database requires a catalog name.

2021-01-06 12:37:36  ERROR   OGG-01668  PROCESS ABENDING.

--//这个报错就是前面的参数文件没有设置SOURCECATALOG导致,可以参考
https://docs.oracle.com/en/middleware/goldengate/core/19.1/oracle-db/configuring-oracle-goldengate-multitenant-container-database-1.html#GUID-26AFC906-E67D-448E-93EC-FE2A54679793

[2021-01-06] Oracle19C RAC 搭建OGG聚合模式同步数据到11.2.0.4详细记录_第1张图片

--//添加SOURCECATALOG参数之后,再次启动

GGSCI (dm01) 20> view params exint

extract exint
setenv (ORACLE_SID = "qxy1")
setenv (NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")
userid c##goldengate, password goldengate
TRANLOGOPTIONS INTEGRATEDPARAMS(parallelism 2)
TRANLOGOPTIONS GETCTASDML
DDL INCLUDE MAPPED
exttrail /ogg/ogg/trails/w1,FORMAT RELEASE 12.2
discardfile /ogg/ogg/dirdat/exint.dsc, append, megabytes 100
getupdatebefores
nocompressdeletes
nocompressupdates
--LOGALLSUPCOLS
dboptions allowunusedcolumn
fetchoptions nousesnapshot
fetchoptions fetchpkupdatecols

SOURCECATALOG PDB1
table pg.*;


GGSCI (dm01) 21> 

--//启动再次报错

Source Context :
  SourceModule            : [er.redo.oraxo]
  SourceID                : [er/redo/oracle/redooraix.c]
  SourceMethod            : [validateConfig]
  SourceLine              : [11612]
  ThreadBacktrace         : [15] elements
                          : [/ogg/ogg/libgglog.so(CMessageContext::AddThreadContext())]
                          : [/ogg/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...))]
                          : [/ogg/ogg/libgglog.so(_MSG_(CSourceContext*, int, CMessageFactory::MessageDisposition))]
                          : [/ogg/ogg/extract()]
                          : [/ogg/ogg/extract(RedoAPI::createInstance(ggs::gglib::ggdatasource::DataSource*, ggs::gglib::ggapp::Repli
cationContext*))]

...skipping one line
                          : [/ogg/ogg/extract(ggs::gglib::ggapp::ReplicationContext::establishStartPoints(char, ggs::gglib::ggdatasou
rce::DataSourceParams const&))]
                          : [/ogg/ogg/extract(ggs::gglib::ggapp::ReplicationContext::initializeDataSources(ggs::gglib::ggdatasource::
DataSourceParams&))]
                          : [/ogg/ogg/extract()]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::MainThread::ExecMain())]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::Threa
dArgs*))]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/ogg/ogg/extract(main)]
                          : [/lib64/libc.so.6(__libc_start_main)]
                          : [/ogg/ogg/extract()]

2021-01-06 12:41:33  ERROR   OGG-02022  Logmining server does not exist on this Oracle database.

2021-01-06 12:41:33  ERROR   OGG-01668  PROCESS ABENDING.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 17> 

参考:
ERROR OGG-02022 Logmining server does not exist on this Oracle database. (Doc ID 1525272.1)
--//检查发现extract名字有问题,刚开始注册的时候是EXTORA,抽取进程为exint,重新注册为exint(所以注册的名字要和抽取的名字一致)

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 17> REGISTER EXTRACT EXINT DATABASE CONTAINER(PDB1)

2021-01-06 12:47:06  INFO    OGG-02003  Extract EXINT successfully registered with database at SCN 11842588.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 18> 

--//再次启动抽取进程,启动正常

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 24> view report exint


***********************************************************************
                 Oracle GoldenGate Capture 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:58
 
Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

                    Starting at 2021-01-06 12:47:34
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Thu Oct 29 17:29:29 EDT 2015, Release 3.10.0-327.el7.x86_64
Node: dm01
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: 87038

Description: 

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************

2021-01-06 12:47:34  INFO    OGG-03059  Operating system character set identified as UTF-8.

2021-01-06 12:47:34  INFO    OGG-02695  ANSI SQL parameter syntax is used for parameter parsing.

2021-01-06 12:47:34  INFO    OGG-02095  Successfully set environment variable ORACLE_SID=qxy1.

2021-01-06 12:47:34  INFO    OGG-02095  Successfully set environment variable NLS_LANG=AMERICAN_AMERICA.AL32UTF8.

2021-01-06 12:47:34  INFO    OGG-01360  EXTRACT is running in Integrated mode.
extract exint
setenv (ORACLE_SID = "qxy1")
setenv (NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")
userid c##goldengate, password ***
TRANLOGOPTIONS INTEGRATEDPARAMS(parallelism 2)
TRANLOGOPTIONS GETCTASDML
DDL INCLUDE MAPPED
exttrail /ogg/ogg/trails/w1
discardfile /ogg/ogg/dirdat/exint.dsc, append, megabytes 100
getupdatebefores
nocompressdeletes
nocompressupdates
dboptions allowunusedcolumn
fetchoptions nousesnapshot
fetchoptions fetchpkupdatecols
SOURCECATALOG PDB1
table pg.*;

2021-01-06 12:47:40  INFO    OGG-02623  Default source catalog name PDB1 will be used for source table name pg.* mapping.

2021-01-06 12:47:41  INFO    OGG-01635  BOUNDED RECOVERY: not used. NORMAL RECOVERY only used due to altered checkpoint.

2021-01-06 12:47:41  INFO    OGG-01815  Virtual Memory Facilities for: BR
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /ogg/ogg/BR/EXINT.

Bounded Recovery Parameter:
BRINTERVAL = 4HOURS
BRDIR      = /ogg/ogg/

2021-01-06 12:47:41  INFO    OGG-01851  filecaching started: thread ID: 140049302783744.

2021-01-06 12:47:41  INFO    OGG-01815  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /ogg/ogg/dirtmp.

2021-01-06 12:47:41  INFO    OGG-25340  
Database Version:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production.

2021-01-06 12:47:41  INFO    OGG-25341  
Database Language and Character Set:
NLS_LANGUAGE     = "AMERICAN" 
NLS_TERRITORY    = "AMERICA" 
NLS_CHARACTERSET = "AL32UTF8".

2021-01-06 12:47:47  INFO    OGG-06604  Database QXY CPU info: CPU Count 4, CPU Core Count 4, CPU Socket Count 2.

2021-01-06 12:47:47  INFO    OGG-06618  Database QXY Platform: Linux x86 64-bit.



GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 25> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     EXINT       00:00:00      00:17:20    


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 26> 

--//一会又abend,发现是配置路径没有修改 忘记创建本地trail文件, 创建本地trail文件

2021-01-06 12:48:48  ERROR   OGG-01044  The trail '/ogg/ogg/trails/w1' is not assigned to extract 'EXINT'. Assign the trail to the ex
tract with the command "ADD EXTTRAIL/RMTTRAIL /ogg/ogg/trails/w1, EXTRACT EXINT".

2021-01-06 12:48:48  ERROR   OGG-01668  PROCESS ABENDING.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 28> ADD EXTTRAIL/RMTTRAIL /ogg/ogg/trails/w1, EXTRACT EXINT
ERROR: Invalid command.

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 29> ADD EXTTRAIL /ogg/ogg/trails/w1, EXTRACT EXINT
EXTTRAIL added.

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 30> 

--//重新启动正常

--//pdb1中的pg用户插入数据测试

[oracle@dm01 ogg]$ sqlplus pg/postgres@PDB1

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 6 12:52:29 2021
Version 19.7.0.0.0

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

Last Successful login time: Wed Jan 06 2021 10:39:33 +08:00

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

SQL> show user
USER is "PG"
SQL> show con_name

CON_NAME
------------------------------
PDB1
SQL> desc t1
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID                                                 NUMBER(38)

SQL> insert into t1 values (10);

1 row created.

SQL> commit;

Commit complete.

SQL> 

--//查看抽取进程,抽取成功

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 35> stats exint

Sending STATS request to EXTRACT EXINT ...

Start of Statistics at 2021-01-06 12:54:11.

DDL replication statistics (for all trails):

*** Total statistics since extract started     ***
        Operations                                         0.00
        Mapped operations                                  0.00
        Unmapped operations                                0.00
        Other operations                                   0.00
        Excluded operations                                0.00

Output to /ogg/ogg/trails/w1:

Extracting from PDB1.PG.T1 to PDB1.PG.T1:

*** Total statistics since 2021-01-06 12:53:55 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Daily statistics since 2021-01-06 12:53:55 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Hourly statistics since 2021-01-06 12:53:55 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Latest statistics since 2021-01-06 12:53:55 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

End of Statistics.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 36> 

--//在RAC的2节点 插入一条数据

[oracle@dm02 ~]$ o

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 6 13:58:29 2021
Version 19.7.0.0.0

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


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

SQL> set lin 200
SQL>  show parameter instance

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
active_instance_count                integer
cluster_database_instances           integer                2
instance_abort_delay_time            integer                0
instance_groups                      string
instance_mode                        string                 READ-WRITE
instance_name                        string                 qxy2
instance_number                      integer                2
instance_type                        string                 RDBMS
open_links_per_instance              integer                4
parallel_instance_group              string
SQL> alter session set container=PDB1;

Session altered.

SQL> conn pg/postgres@PDB1
Connected.
SQL> select * from t1;

        ID
----------
        10

SQL> insert into t1 values (11);

1 row created.

SQL> commit;

Commit complete.

SQL> 

--//在实例1查看exint抽取进程,发现数据已经抽取到

GSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 36> stats exint 

Sending STATS request to EXTRACT EXINT ...

Start of Statistics at 2021-01-06 13:59:39.

DDL replication statistics (for all trails):

*** Total statistics since extract started     ***
        Operations                                         0.00
        Mapped operations                                  0.00
        Unmapped operations                                0.00
        Other operations                                   0.00
        Excluded operations                                0.00

Output to /ogg/ogg/trails/w1:

Extracting from PDB1.PG.T1 to PDB1.PG.T1:

*** Total statistics since 2021-01-06 12:53:55 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Daily statistics since 2021-01-06 12:53:55 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Hourly statistics since 2021-01-06 13:00:00 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Latest statistics since 2021-01-06 12:53:55 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

End of Statistics.

--//配置投递进程
--//源端配置:聚合模式 Pump Extract
--//添加一个pump进程,并指定远程trail文件
--//exttrailsource的内容就是exint抽取进程的exttrail /ogg/ogg/trails/w1
add extract exppint,exttrailsource /ogg/ogg/trails/w1
 

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 38> add extract exppint,exttrailsource /ogg/ogg/trails/w1
EXTRACT added.


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 39> 

--//编辑pump文件
--//rmthost为目标端的ip地址
--//rmttrail目标端存放trail文件的目录,提前在目标端创建好
edit params exppint

EXTRACT exppint
passthru
rmthost 192.168.40.170, mgr port 7809
rmttrail /home/oracle/OGG/19ctrails/pi
table pg.*;

--//目标端的信息

[oracle@QXY 19ctrails]$ ifconfig -a | grep 'inet addr' | grep 170
          inet addr:192.168.40.170  Bcast:192.168.40.255  Mask:255.255.255.0
          inet addr:192.168.170.128  Bcast:192.168.170.255  Mask:255.255.255.0
[oracle@QXY 19ctrails]$ pwd
/home/oracle/OGG/19ctrails
[oracle@QXY 19ctrails]$ 

--//指定目标端的trail文件

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 45> add rmttrail /home/oracle/OGG/19ctrails/pi, extract exppint
RMTTRAIL added.

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 46> 

--//启动投递进程

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 57> start exppint

Sending START request to MANAGER ...
EXTRACT EXPPINT starting


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 58> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     EXINT       00:00:00      00:00:09    
EXTRACT     RUNNING     EXPPINT     00:00:00      00:00:44    

--//投递进程abend

2021-01-06 14:15:51  WARNING OGG-06600  The remote peer for remote trail /home/oracle/OGG/19ctrails/pi does not support 9 digit seqle
n feature. Continuing with 6 digit seqlen.

2021-01-06 14:15:51  INFO    OGG-01052  No recovery is required for target file /home/oracle/OGG/19ctrails/pi000000, at RBA 0 (file n
ot opened).

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


2021-01-06 14:15:51  INFO    OGG-02243  Opened trail file /ogg/ogg/trails/w1000000000 at 2021-01-06 14:15:51.793280.

2021-01-06 14:15:51  INFO    OGG-01478  Output file /home/oracle/OGG/19ctrails/pi is using format RELEASE 19.1.

Source Context :
  SourceModule            : [ggapp.wildcard]
  SourceID                : [../gglib/ggapp/wildcard.c]
  SourceMethod            : [WILDCARD_check_table]
  SourceLine              : [1759]
  ThreadBacktrace         : [15] elements
                          : [/ogg/ogg/libgglog.so(CMessageContext::AddThreadContext())]
                          : [/ogg/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...))]
                          : [/ogg/ogg/libgglog.so(_MSG_QualTableName_QualTableName(CSourceContext*, int, ggs::gglib::ggapp::CQualDBOb
jName<(DBObjType)1> const&, ggs::gglib::ggapp::CQualDBObjName<(DBObjType)1> const&, CMessageFactory::MessageDisposition))]
                          : [/ogg/ogg/extract()]
                          : [/ogg/ogg/extract(ggs::er::ERContext::findSourceMetadata(ggs::gglib::ggapp::CQualDBObjName<(DBObjType)1> 
const&, int, ggs::gglib::ggmetadata::CTblMetadata*, ggs::gglib::ggmetadata::CMetadataReader*, bool))]
                          : [/ogg/ogg/extract(ggs::gglib::ggapp::ReplicationContext::sourceMetadataLookup(ggs::gglib::gglcr::CommonLC
R const*))]
                          : [/ogg/ogg/extract(ggs::er::ExtractContext::processPumpLoop())]
                          : [/ogg/ogg/extract(ggs::er::ExtractContext::run())]
                          : [/ogg/ogg/extract()]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::MainThread::ExecMain())]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::Threa
dArgs*))]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/ogg/ogg/extract(main)]
                          : [/lib64/libc.so.6(__libc_start_main)]
                          : [/ogg/ogg/extract()]

2021-01-06 14:15:51  ERROR   OGG-02650  Source wildcard specification pg.* does not include a catalog name, but the source table name
 PDB1.PG.T1 includes a catalog name.

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

--//添加SOURCECATALOG参数

edit params exppint

EXTRACT exppint
passthru
rmthost 192.168.40.170, mgr port 7809
rmttrail /home/oracle/OGG/19ctrails/pi
SOURCECATALOG pdb1
table pg.*;

--//再次启动成功

GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 64> start exppint

Sending START request to MANAGER ...
EXTRACT EXPPINT starting


GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 65> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
EXTRACT     RUNNING     EXINT       00:00:00      00:00:05    
EXTRACT     RUNNING     EXPPINT     00:00:00      00:02:34    
GGSCI (dm01 as c##goldengate@qxy1/CDB$ROOT) 72> stats exppint

Sending STATS request to EXTRACT EXPPINT ...

Start of Statistics at 2021-01-06 14:18:46.

Output to /home/oracle/OGG/19ctrails/pi:

Extracting from PDB1.PG.T1 to PDB1.PG.T1:

*** Total statistics since 2021-01-06 14:18:32 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Daily statistics since 2021-01-06 14:18:32 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Hourly statistics since 2021-01-06 14:18:32 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Latest statistics since 2021-01-06 14:18:32 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

End of Statistics.

--//配置目标库,目标库是11g的单实例
--//trails文件已经投递进来

[oracle@QXY 19ctrails]$ ls -ltr
total 4
-rw-r-----. 1 oracle oinstall 1917 Jan  6 14:18 pi000000
[oracle@QXY 19ctrails]$ 

--//目标库本身已经有ogg,这里只需要配置replicat进程
--//目标库ogg版本为12.1
--//配置checkpoint(非必须)

edit params ./GLOBALS
ggschema goldengate
checkpointtable goldengate.ggschkpt

--//配置replicat抽取进程

add replicat w1rep19c,exttrail /home/oracle/OGG/19ctrails/pi,checkpointtable goldengate.ggschkpt


GGSCI (QXY.localdomain) 4> add replicat w1rep19c,exttrail /home/oracle/OGG/19ctrails/pi,checkpointtable goldengate.ggschkpt
REPLICAT added.


GGSCI (QXY.localdomain) 5> 

--//编辑参数
--//目标库已经存在pg用户且该用户下面有t1表

edit params w1rep19c

replicat w1rep19c 
SETENV (NLS_LANG ="AMERICAN_AMERICA.ZHS16GBK")
USERID goldengate, PASSWORD goldengate
--assumetargetdefs
ReportCount Every 30 Minutes, Rate
Report at 01:00
ReportRollover at 01:15
reperror default,abend 
discardfile ./dirout/w1rep19c.dsc, append, megabytes 100
DiscardRollover at 02:00 ON SUNDAY
--ddl include all
ddlerror default discard retryop maxretries 2 retrydelay 5
dynamicresolution
--MAP goldengate.*, TARGET goldengate.*;
DBOPTIONS NOSUPPRESSTRIGGERS
ALLOWNOOPUPDATES
ASSUMETARGETDEFS
map pg.*, target pg.*;

--//启动应用进程
--//启动报错

2021-01-06 14:28:51  ERROR   OGG-01332  File /home/oracle/OGG/19ctrails/pi000000, with compatibility level 7, is not compatible with 
the current software version's compatibility level of 4. Modify the file writer's parameter file to generate the appropriate format u
sing the FORMAT LEVEL 4 option.

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

Reading /home/oracle/OGG/19ctrails/pi000000, current RBA 0, 0 records

Report at 2021-01-06 14:28:51 (activity since 2021-01-06 14:28:48)

可以参考MOS
GG Pump abend with Error OGG-01332 (Doc ID 2219940.1)
Source container database requires trail FORMAT 12.3/18.1 or higher.

--//如果修改抽取段的release格式,FORMAT RELEASE 12.2,会提示Source container database requires trail FORMAT 12.3/18.1 or higher.

GGSCI (dm01) 19> view params exint

extract exint
setenv (ORACLE_SID = "qxy1")
setenv (NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")
userid c##goldengate, password goldengate
TRANLOGOPTIONS INTEGRATEDPARAMS(parallelism 2)
TRANLOGOPTIONS GETCTASDML
DDL INCLUDE MAPPED
exttrail /ogg/ogg/trails/w1,FORMAT RELEASE 12.2     <=====增加FORMAT RELEASE 12.2
discardfile /ogg/ogg/dirdat/exint.dsc, append, megabytes 100
getupdatebefores
nocompressdeletes
nocompressupdates
--LOGALLSUPCOLS
dboptions allowunusedcolumn
fetchoptions nousesnapshot
fetchoptions fetchpkupdatecols

SOURCECATALOG PDB1
table pg.*;

--//启动rep进程失败

2021-01-06 15:01:49  INFO    OGG-01851  filecaching started: thread ID: 140111624648448.

2021-01-06 15:01:49  INFO    OGG-01815  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /ogg/ogg/dirtmp.

2021-01-06 15:01:49  INFO    OGG-25340  
Database Version:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production.

2021-01-06 15:01:49  INFO    OGG-25341  
Database Language and Character Set:
NLS_LANGUAGE     = "AMERICAN" 
NLS_TERRITORY    = "AMERICA" 
NLS_CHARACTERSET = "AL32UTF8".

2021-01-06 15:01:51  INFO    OGG-06604  Database QXY CPU info: CPU Count 4, CPU Core Count 4, CPU Socket Count 2.

2021-01-06 15:01:51  INFO    OGG-06618  Database QXY Platform: Linux x86 64-bit.

2021-01-06 15:01:55  WARNING OGG-02909  CTAS not supported with replicat versions lower than 12.1.2.1.0.

2021-01-06 15:01:56  WARNING OGG-02045  Database does not have streams_pool_size initialization parameter configured.

2021-01-06 15:01:57  INFO    OGG-02248  Logmining server DDL filtering enabled.

2021-01-06 15:01:58  INFO    OGG-02339  Integrated capture successfully attached to logmining server OGG$CAP_EXINT using 60 second st
reaming duration.

2021-01-06 15:01:58  INFO    OGG-02089  Source redo compatibility version is: 18.0.0.

...skipping one line
2021-01-06 15:01:58  INFO    OGG-02086  Integrated Dictionary will be used.

Source Context :
  SourceModule            : [er.redo.oraxo]
  SourceID                : [er/redo/oracle/redooraix.c]
  SourceMethod            : [validateOutTrailFileCompatibility]
  SourceLine              : [11962]
  ThreadBacktrace         : [16] elements
                          : [/ogg/ogg/libgglog.so(CMessageContext::AddThreadContext())]
                          : [/ogg/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...))]
                          : [/ogg/ogg/libgglog.so(_MSG_String(CSourceContext*, int, char const*, CMessageFactory::MessageDisposition)
)]
                          : [/ogg/ogg/extract()]
                          : [/ogg/ogg/extract(RedoIE::validateConfig(log_context_t*, ggs::gglib::ggocicpp::ORAConnection*, ggs::gglib
::ggdatasource::DataSource*, ggs::gglib::ggapp::ReplicationContext*))]
                          : [/ogg/ogg/extract(RedoAPI::createInstance(ggs::gglib::ggdatasource::DataSource*, ggs::gglib::ggapp::Repli
cationContext*))]
                          : [/ogg/ogg/extract(ggs::er::OraTranLogDataSource::setup())]
                          : [/ogg/ogg/extract(ggs::gglib::ggapp::ReplicationContext::establishStartPoints(char, ggs::gglib::ggdatasou
rce::DataSourceParams const&))]
                          : [/ogg/ogg/extract(ggs::gglib::ggapp::ReplicationContext::initializeDataSources(ggs::gglib::ggdatasource::
DataSourceParams&))]
                          : [/ogg/ogg/extract()]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::MainThread::ExecMain())]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::Threa
dArgs*))]
                          : [/ogg/ogg/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/ogg/ogg/extract(main)]
                          : [/lib64/libc.so.6(__libc_start_main)]
                          : [/ogg/ogg/extract()]

2021-01-06 15:01:59  ERROR   OGG-06221  Source container database requires trail FORMAT 12.3/18.1 or higher.

2021-01-06 15:01:59  ERROR   OGG-01668  PROCESS ABENDING.

--//这里就升级目标的ogg了,详细可以参考下面的连接
https://docs.oracle.com/en/middleware/goldengate/core/19.1/upgrading/upgrading-oracle-goldengate-oui.html
Upgrading Oracle GoldenGate from OUI

安装时要选择11g,因为目标库是11g的数据库

[2021-01-06] Oracle19C RAC 搭建OGG聚合模式同步数据到11.2.0.4详细记录_第2张图片

选择一个新的安装目录,端口可以选择和旧的不一致

[2021-01-06] Oracle19C RAC 搭建OGG聚合模式同步数据到11.2.0.4详细记录_第3张图片

[2021-01-06] Oracle19C RAC 搭建OGG聚合模式同步数据到11.2.0.4详细记录_第4张图片

[2021-01-06] Oracle19C RAC 搭建OGG聚合模式同步数据到11.2.0.4详细记录_第5张图片

[2021-01-06] Oracle19C RAC 搭建OGG聚合模式同步数据到11.2.0.4详细记录_第6张图片

--//使用新版本重新创建复制进程

[oracle@QXY OGG_19C]$ ./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 11g on Oct 17 2019 23:13:12
Operating system character set identified as UTF-8.

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



GGSCI (QXY.localdomain) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           


GGSCI (QXY.localdomain) 2> 

--//配置checkpoint
edit params ./GLOBALS
ggschema goldengate
checkpointtable goldengate.ggscheckpiont

GGSCI (QXY.localdomain) 3>  dblogin userid goldengate, password goldengate
Successfully logged into database.

GGSCI (QXY.localdomain as goldengate@QXY) 4> add checkpointtable goldengate.ggscheckpiont

Successfully created checkpoint table goldengate.ggscheckpiont.

GGSCI (QXY.localdomain as goldengate@QXY) 5> 

--//配置replicat抽取进程

GGSCI (QXY.localdomain as goldengate@QXY) 5> add replicat w1rep19c,exttrail /home/oracle/OGG/19ctrails/pi,checkpointtable goldengate.ggscheckpiont
REPLICAT added.


GGSCI (QXY.localdomain as goldengate@QXY) 6> 

--//编辑参数
--//目标库已经存在pg用户且该用户下面有t1表

edit params w1rep19c

replicat w1rep19c 
SETENV (NLS_LANG ="AMERICAN_AMERICA.ZHS16GBK")
USERID goldengate, PASSWORD goldengate
--assumetargetdefs
ReportCount Every 30 Minutes, Rate
Report at 01:00
ReportRollover at 01:15
reperror default,abend 
discardfile ./dirout/w1rep19c.dsc, append, megabytes 100
DiscardRollover at 02:00 ON SUNDAY
--ddl include all
ddlerror default discard retryop maxretries 2 retrydelay 5
--MAP goldengate.*, TARGET goldengate.*;
DBOPTIONS NOSUPPRESSTRIGGERS
ALLOWNOOPUPDATES
ASSUMETARGETDEFS
map pg.*, target pg.*;

--//启动应用进程

GGSCI (QXY.localdomain as goldengate@QXY) 7> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
REPLICAT    STOPPED     W1REP19C    00:00:00      00:01:04    


GGSCI (QXY.localdomain as goldengate@QXY) 8> start rep W1REP19C

Sending START request to MANAGER ...
REPLICAT W1REP19C starting


GGSCI (QXY.localdomain as goldengate@QXY) 9> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
REPLICAT    ABENDED     W1REP19C    00:00:00      00:01:14    

--//启动报错,虽然目标库不是CDB格式,还是要指定SOURCECATALOG 
--//参考Configuring Oracle GoldenGate in a Multitenant Container Database,地址如下:
https://docs.oracle.com/en/middleware/goldengate/core/19.1/oracle-db/configuring-oracle-goldengate-multitenant-container-database-1.html#GUID-2A72F463-C5B6-4A4C-8BDF-537AAD01BEE4

2021-01-06 15:23:38  ERROR   OGG-02650  Source wildcard specification pg.* does not include a catalog name, but the source table name
 PDB1.PG.T1 includes a catalog name.

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

--//添加上SOURCECATALOG 再次启动

GGSCI (QXY.localdomain as goldengate@QXY) 11> edit params w1rep19c
replicat w1rep19c
SETENV (NLS_LANG ="AMERICAN_AMERICA.ZHS16GBK")
USERID goldengate, PASSWORD goldengate
--assumetargetdefs
ReportCount Every 30 Minutes, Rate
Report at 01:00
ReportRollover at 01:15
reperror default,abend
discardfile ./dirout/w1rep19c.dsc, append, megabytes 100
DiscardRollover at 02:00 ON SUNDAY
--ddl include all
ddlerror default discard retryop maxretries 2 retrydelay 5
dynamicresolution
--MAP goldengate.*, TARGET goldengate.*;
DBOPTIONS NOSUPPRESSTRIGGERS
ALLOWNOOPUPDATES
ASSUMETARGETDEFS
SOURCECATALOG PDB1
map pg.*, target pg.*;
~

--//启动成功

GGSCI (QXY.localdomain as goldengate@QXY) 13> start rep W1REP19C

Sending START request to MANAGER ...
REPLICAT W1REP19C starting


GGSCI (QXY.localdomain as goldengate@QXY) 14> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           
REPLICAT    RUNNING     W1REP19C    00:00:00      00:00:01    


GGSCI (QXY.localdomain as goldengate@QXY) 15> 

GGSCI (QXY.localdomain as goldengate@QXY) 16> stats W1REP19C

Sending STATS request to REPLICAT W1REP19C ...

Start of Statistics at 2021-01-06 15:28:12.

Replicating from PDB1.PG.T1 to PG.T1:

*** Total statistics since 2021-01-06 15:27:50 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Daily statistics since 2021-01-06 15:27:50 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Hourly statistics since 2021-01-06 15:27:50 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Latest statistics since 2021-01-06 15:27:50 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total upserts                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

End of Statistics.


GGSCI (QXY.localdomain as goldengat

--//进入数据库查看

[oracle@QXY OGG_19C]$ o

SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 6 15:28:39 2021

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> conn pg/postgres
Connected.
SQL> select * from t1;

        ID
----------
        10
        11

SQL> 

--//至此,从19c RAC到11.2.0.4 单实例ogg同步搭建完成。
 

你可能感兴趣的:(goldengate,oracle,ogg升级,19c到11g,ogg搭建,19c,RAC,聚合抽取)