前言:
Oracle Ogg集成模式比起经典模式功能更加的强大,支持更多的数据类型,压缩表同步,XA事务,多线程模式,PDB模式同步,RAC环境下抽取配置简单等新功能,所以可以选择将经典模式升级转化为集成模式以提升Ogg的功能以及性能
配置介绍:
OGG软件:19.1.0.0.4
源端:
extract :ext_text
pump :pum_test
目标端:
replicat:rep_test
集成复制升级条件:
1 数据库版本11.2.0.3 or higher
2.安装支持集成模式所需要的补丁
参考MOS documentNOTE:1411356.1 - 11.2.0.3 Database specific bundle patch for Integrated Extract 11.2.x
3 OGG软件 11.2.x or higher
extract升级过程:
1 数据库管理权限给ogg用户
SQL> exec dbms_goldengate_auth.grant_admin_privilege('ogg')
2 如果是RAC环境并且OGG VERSIONS 11.2.1.0.23+,需要执行TRANLOPTIONS option PREPAREFORUPGRADETOIE 避免bug 18103455 的发生
对正在运行的extract进程,执行以下命令
GGSCI> SEND extract ext_test tranlogoptions prepareforupgradetoie
停止extract进程,配置文件里面添加以下条目,再启动
GGSCI> TRANLOGOPTIONS PREPAREFORUPGRADETOIE
监控ggserr.log日志或者是extract日志,确认参数生效GG-01873 message
Example from report file:
2014-06-05 17:06:09 INFO OGG-01873 The parameter TRANLOGOPTIONS PREPAREFORUPGRADETOIE has taken effect. Proceed to the next step in the upgrade process.
Example from ggserr.log file:
2014-06-05 17:06:09 INFO OGG-01873 Oracle GoldenGate Capture for Oracle, src.prm: The parameter TRANLOGOPTIONS PREPAREFORUPGRADETOIE has taken effect.
只有进程处理了事务才会显示info信息,所以可以通过添加一张测试表进行触发事务进行验证或者等待事务产生
确认参数生效GG-01873 message,才可以暂停extract进程
3 关闭extract进程
GGSCI> DBLOGIN userid ogg, password "go_20230_W506"
GGSCI> stop extract ext_test
4 extract进程注册到数据库
GGSCI> register extract ext_test database
2023-10-31 16:17:33 INFO OGG-02003 Extract EXT_TEST successfully registered with database at SCN 2521979.
注册之后,在数据库可以查到抽取进程
SQL> select CAPTURE_NAME,STATUS,LOGMINER_ID
2 from dba_capture;
CAPTURE_NAME STATUS LOGMINER_ID
------------------------------ -------- -----------
OGG$CAP_EXT_TEST ENABLED 1
5 查看进程是否可以进行更新,需要确保在upgrade之前的事务已经写入队列文件
GGSCI> info extract ext_test upgrade
ERROR表示不能进行更新: Extract EXT_TEST is not ready to be upgraded because recovery SCN 1616790 has not reached SCN 2521979.,
需要重新启动extract进程,直到scn达到要求2521979才能更新
GGSCI> start extract ext_test
如果出现某个thread的scn一直未变化的情况,可能是因为该节点没有事务在进行,这时候可以手动在thread 所在的节点执行事务触发scn变化
然后再次执行更新确认
GGSCI> info extract ext_test upgrade
Extract EXT_TEST is ready to be upgraded to integrated capture. --表示可以进行更新
确认可以更新之后关闭extract进程
GGSCI> stop extract ext_test
6 extract执行更新升级为集成模式
GGSCI> alter extract ext_test,upgrade integrated tranlog
Extract EXT_TEST successfully upgraded to integrated capture.
7 编辑extract参数文件,删除集成模式不支持的参数TRANLOGOPTIONS,DBLOGREADER,添加集成模式参数
TRANLOGOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 100, PARALLELISM 2)
8 启动extract
GGSCI> start extract ext_test
9 检查是否使用了集成模式
GGSCI> info extract ext_test
replicat升级过程:
注:经典模式的replicat也能应用集成模式下的抽取的队列
1 关闭replicat进程
GGSCI> stop replicat rep_test
2 添加集成复制的参数
GGSCI> edit params rep_test
GGSCI> DBOPTIONS INTEGRATEDPARAMS (MAX_SGA_SIZE 100, PARALLELISM 2)
3 修改为集成复制模式
GGSCI> DBLOGIN userid ogg, password "go_20230_W506"
GGSCI> alter replicat rep_test INTEGRATED
2023-10-31 17:40:45 INFO OGG-06594 Replicat REP_TEST has been altered. Even the start up position might be updated, duplicate suppression remains active in next startup. To override duplicate suppression, start REP_TEST with NOFILTERDUPTRANSACTIONS option.
REPLICAT (Integrated) altered.
4 启动应用进程
GGSCI> start rep_test
5 检查是否使用了集成模式INTEGRATED Replicat
GGSCI> info rep_test,detail
REPLICAT REP_TEST Initialized 2023-10-31 17:40 Status STOPPED
INTEGRATED
Checkpoint Lag 00:06:31 (updated 00:01:07 ago)
Log Read Checkpoint File /u01/ogg/dirdat/ro000000001
2023-10-31 17:34:13.621532 RBA 125074090
INTEGRATED Replicat
DBLOGIN Provided, no inbound server is defined
6 查看应用进程的执行情况
集成复制没有使用检查表,可以通过数据库的数据字段进行查询
SQL> select * from DBA_APPLY
SQL> select * from DBA_GG_INBOUND_PROGRESS