一、需求,Oracle Db 11.2.0.1 ->Db19.3 pdb 使用Ogg 同步
根据上述需求!
二、问题
这个需求取决于很多客户想上19c了,ogg属于可以0停机窗口|跨平台|跨字符集|跨数据库版本,多个优点于一体的迁移升级方案!
使用Oracle Db 10.2.0.5 <=> Oracle Db 19.3,ogg 如何配置?
使用Oracle Db 11.2.0.1 ,ogg 11.2 <=> Oracle Db 19.3 ,ogg 19.1 能否进行双向同步?
使用Oracle Db 11.2.0.4 <=> Oracle Db 19.3,ogg 又如何配置呢?
根据上述问题,查询相关资料,对部分进行测试整理。
三、版本相关资料
https://blog.csdn.net/ghostliming/article/details/72830291 https://www.cnblogs.com/margiex/p/7865024.html OGG-06221源容器数据库需要Trail FORMAT 12.3或更高版本(文档ID 2315957.1) 兼容性级别为6的Pump abend-OGG-01332文件xxx与当前软件版本的兼容性级别5不兼容。(Doc ID 2316837.1) 兼容级别为6的错误OGG-01332的复制异常终止与当前软件版本的兼容级别5不兼容。(文档ID 2385520.1)
GoldenGate Replicat abend with "OGG-01332 File dirdat\xx, with compatibility level 3, is not compatible with the
current software version‘s compatibility level of 2 (Doc ID 1451840.1) https://docs.oracle.com/en/middleware/goldengate/core/19.1/gclir/add-exttrail.html#GUID-C3330B6A-9514-4015-996E-2461BE36273D
3.1)19.1 ogg 官方文档,描述12.2 DB版本OGG 最低版本兼容性
The following settings are supported for Oracle Database 12.2 and higher: For Oracle Database 12.2 non-CDB or higher with compatibility set to 12.1, FORMAT RELEASE 12.2 or above is supported. For Oracle Database 12.2 non-CDB or higher with compatibility set to 12.2, FORMAT RELEASE 12.2 or above is supported. For Oracle Database 12.2 CDB/PDB or higher with compatibility set to 12.2, only FORMAT RELEASE values 12.3 or higher are supported.
This is due to the use of local undo for PDBs, which requires augmenting the transaction ID with the PDB number to ensure uniqueness
of trx IDs.
FOr DB >=12.2,compatibility <=12.2 AND NO PDB ,OGG 最低的format release 12.2!
上述版本 AND PDB ! 最低format release 12.3!!!
3.2) MOS 2315957.1,DB 12.2 PDB 使用OGG 能不能降低到12.2 ?
Source: Oracle Database 12.2.0.1.0 Multitenant - OGG version 12.3 Target: Oracle Database 12.1.0.2 - OGG version 12.2 Classic Replicat would abend with following message since Source version is higher 2017-10-04 20:56:16 ERROR OGG-01332 File ./dirdat/HIPOS/mb000000001, with compatibility level 6, is not compatible
with the current software version‘s compatibility level of 5. Modify the file writer‘s parameter file to generate the
appropriate format using the FORMAT LEVEL 5 option. Classic Extract and Pump configuration was changed on source to change the trail format to 12.2 so that Replicat doesn‘t error. Extract <Extract name> EXTTRAIL ./dirdat/ea, FORMAT RELEASE 12.2 Extract <Pump> RMTTRAIL ./dirdat/ra, FORMAT RELEASE 12.2 However doing so leads to following issues 1) Extract would error with following OGG-06221 Source container database requires trail FORMAT 12.3 or higher. 2) Pump would run fine although trail format still remains in 12.3 since Source Extract never was never able to convert the
format to 12.2 INFO OGG-01478 Output file ./dirdat/HIPOS/mb is using format RELEASE 12.3. SOLUTION CDB in RDBMS binary 12.2 requires trail format to be 12.3 due to features that are not guarded by db compatible, like local undo. Hence Extract has to use 12.3 format for trails when running against Oracle Database 12.2 with CDB/PDB
本例中DB 12.2 ,COM 12.2,PDB OGG 12.3 抽取进程,投递进程版本都降低为12.2 !!! 但是复制进程报错,提升版本level =6,需要降低为level 5才ok
mos给出了说法! pdb like local undo trail format to be 12.3 !!! 参数写12.2没有用!
3.3) 2316837.1,源端12.2,目标端12.3,低到高版本,低版本指定release 12.2 的情况
SYMPTOMS While configure replication between 12.2.0.1.0 (source) and 12.3 (target) with the following "format release" parameter in
the parameter files and then while starting pump fails with the following errors and it is an abended: Extract: EXTTRAIL dirdat/ex, format release 12.2 Pump: RMTTRAIL RMTTRAIL dirdat/ms, format release 12.2 017-10-11 09:35:04 INFO OGG-06569 Remote Collector/Server version 12.3 receiving data is a different version than this
Extract 12.2 sending data. 2017-10-11 09:35:09 INFO OGG-01226 Socket buffer size set to 27985 (flush size 27985). 2017-10-11 09:35:09 INFO OGG-01055 Recovery initialization completed for target file dirdat/ms000000000, at RBA 1379. 2017-10-11 09:35:09 INFO OGG-01478 Output file dirdat/ms is using format RELEASE 12.2. ............................................... 2017-10-11 09:35:09 ERROR OGG-01332 File dirdat/ms000000000, with compatibility level 6, is not compatible with the current
software version‘s compatibility level of 5. Modify the file writer‘s parameter file to generate the appropriate format using
the FORMAT LEVEL 5 option. 2017-10-11 09:35:09 ERROR OGG-01668 PROCESS ABENDING. GGSCI (GZW-WJ-DB) 1> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT ABENDED <PUMP-NAME> 00:00:00 00:25:23 EXTRACT RUNNING <EXTRACT-NAME> 00:00:00 00:00:09 CAUSE This can happen if you use parameter FORMAT RELEASE 12.2 when source GG version is 12.2(Lower) and target GG version is 12.3(higher). SOLUTION To resolve the issue, You do not have to use FORMAT RELEASE parameter when source GG version (Example: 12.2) is lower then target GG version(Example: 12.3) so remove the ‘FORMAT RELEASE 12.2‘ parameter from extract/pump parameter file and then re-start the
process. NOTE: In the images and/or the document content above, the user information and data used represents fictitious data from the
Oracle sample schema(s) or Public Documentation delivered with an Oracle database product. Any similarity to actual persons, living or dead, is purely coincidental
and not intended in any manner.
这个案例也很有意思!
12.2.0.1.0 (source) and 12.3 (target) with the following "format release"
就是源端ogg 版本12.2.0.1 ->目标端ogg 12.3,低版本到高版本,并且抽取投递进程中都使用了版本release 12.2!!! 但是复制进程报错!
官方的意思就是,低版本的文件,到高版本Ogg去应用,无需使用版本参数,画蛇添足! 重点,低到高无需进行版本转换!
3.4 ) 1451840.1, Ogg 11.2 源端抽取的trail的文件ogg 11.1 , 10.4无法解析
GoldenGate Replicat abend with "OGG-01332 File dirdat\xx, with compatibility level 3, is not compatible with the current
software version‘s compatibility level of 2 (Doc ID 1451840.1) Oracle GoldenGate - Version 10.0.0.0 and later SYMPTOMS Replicat abending with the following error after a source OGG upgrade. 2012-04-06 09:21:56 ERROR OGG-01332 File dirdat\pj000088, with compatibility level 3, is not compatible with the
current software version‘s compatibility level of 2. Modify the file writer‘s parameter file to generate the appropriate
format using the FORMAT LEVEL 2 option. OR 2012-04-05 19:49:22 GGS ERROR ZZ-0QE File header failed to parse tokens. File dirdat\pj000025, last offset 905, data:
905: 000000013A00000200003B000004000000013C0000140000001014141414141414141414141411141414330000773000000A0008454
F42415232363131000002000332000002000B33000002000234000002000135000002000036000002000137000041003F56657273696F6E2031
312E322E312E302E30204F4747434F5245. The same error could happen when doing a initial load with different OGG versions CAUSE The trail formats between OGG v11.2 and old OGG versions ( v11.1 / 10.4)are different and so a replicat running
with OGG v11.1 / 10.4 cannot read a trail file written by 11.2 extract / pump extract. SOLUTION If the target OGG version is lower than 11.2 and the source is OGG v11.2, we need to use the FORMAT RELEASE parameter
in the master extract(Exttrail) and the pump extract( rmttrail). For ex: Assume that the source is running with OGG v11.2 and the target is running with OGG v11.1, we need the following In master extract exttrail dirdat/pj, format release 11.1 In pump extract RMTTRAIL dirdat\jp, format release 11.1 --------- If the error is been encountered when doing the initial load, we need to add the "Format Release" parameter with the
RMTFILE or RMTTASK accordingly. Please refer the OGG reference guide to more about the FORMAT RELEASE parameter and its usage
总结就是如果源端OGG 11.2,目标端OGG 11.1 OR 10.4无法读取11.2的trail文件,oracle ogg在11.2版本进行了调整,trail文件格式不一样了,如果需要处理!
本例中需要降低版本trail到11.1 !!!
3.5) 2385520.1,Db12.2c Ogg 12.3 to Db11g Ogg 12.2 ,同步是否有什么问题???
SYMPTOMS Setting up a Bidirectoinal replication between Databases 11.2.0.4.0 and 12.2.0.1.0 multitenant database The Oracle Goldengate versions used: Oracle GoldenGate Capture for Oracle Version 12.3.0.1.2 OGGCORE_12.3.0.1.0_PLATFORMS_171208.0005_FBO Linux, x64, 64bit (optimized), Oracle 12c on Dec 9 2017 01:02:18 Oracle GoldenGate Delivery for Oracle Version 12.2.0.2.2 OGGCORE_12.2.0.2.0_PLATFORMS_170630.0419_FBO AIX 6, ppc, 64bit (optimized), Oracle 11g on Jul 3 2017 14:14:26 The replicat that is set-up for 11.2.0.4 database abends with error: ERROR OGG-01332 File /dirdat/rt000000000,
with compatibility level 6, is not compatible with the current software version‘s compatibility level of 5.
Modify the file writer‘s parameter file to generate the appropriate format using the FORMAT LEVEL 5 option. CAUSE OGG configured on source DB is 12.3 and on target database is 12.2. The trail files which are written in 12.3 format
cannot be used by the target. CDB in RDBMS binary 12.2 requires trail format to be 12.3. Hence Extract has to use 12.3 format for trails when running
against Oracle Database 12.2 with CDB/PDB This format cannot be used by the target replicat which is on version 12.2 SOLUTION The recommended solution would be to use OGG 12.3 on both source and target environments. If the use of OGG 12.3 on the target is not feasible due to certification limitations, you could consider one of the
below options to replicat to the target. 1) Set up a remote replicat to replicat changes from the 12.2 multitenant database to the 11.2 target database. 2) Set up a middle tier database. Use this database to setup a downstream mining environment to extract data from the 12.2 CDB.
OGG 12.2 can be used on the downstream mining database and the trails in 12.2 format can be transported to the source 11.2 database
for processing. 3) Set source redo compatibility on 12.2 DB to 12.1. Once the redo compatibility is 12.1, you can use OGG 12.2 with the 12.2 DB
as well
本例中:Db12.2c Ogg 12.3 to Db11g Ogg 12.2 复制进程abend提示 版本level6 ,需要降低1个版本到Level 5
官方建议:
1.都使用同一个OGG 12.3 这样就不存在Og*生的trail文件版本问题了;
2.对抽取进程的12.3 OGG软件上面,配置一个远程复制,这样就不存在版本的问题了;
3.配置一个中间服务器,第一条链路 DB 12.2 Ogg 12.3 -> 中间库DB 11g or 12c;
第二条链路 DB 11g or 12c OGG 12.2 ->目标库11.2.0.4 ;
4.将数据库兼容性版本设置为12.1 !!!
Set source redo compatibility on 12.2 DB to 12.1
四、场景测试
4.1 Source Db 19.3 Ogg 19.1 toTarget Db11.2.0.4 Ogg 11.1
ERROR OGG-00664 OCI Error during OCIServerAttach (status = 12162-Error while trying to retrieve text for error ORA-12162). $ oerr ora 12162 12162, 00000, "TNS:net service name is incorrectly specified" // *Cause: The connect descriptor corresponding to the net service name in // TNSNAMES.ORA or in the directory server (Oracle Internet Directory) is // incorrectly specified. // *Action: If using local naming make sure there are no syntax errors in // the corresponding connect descriptor in the TNSNAMES.ORA file. If using // directory naming check the information provided through the administration // used for directory naming. 报错,配置文件中没有使用tns远程的方式! 无解
4.2 Source Db 19.3 Ogg 19.1 toTarget Db11.2.0.4 Ogg 12.2
> start ext_t1 EXTTRAIL /u01/ogg1/base/dirdat/t2utf8/t1/t1,format release 12.2 2021-05-12 04:26:07 ERROR OGG-06221 Source container database requires trail FORMAT 12.3/18.1 or higher.
抽取进程投递进程降低版本到12.3,复制进程依然报错!
ERROR OGG-01332 File /home/oggtest2/base/dirdat/t1/t1000000000, with compatibility level 7, is not compatible with the current sof
tware version‘s compatibility level of 5. Modify the file writer‘s parameter file to generate the appropriate format using the FORMAT LEVEL 5 option.
4.3 Source Db 19.3 Ogg 19.1 toTarget Db11.2.0.4 Ogg 12.3
EXTTRAIL /u01/ogg1/base/dirdat/t2utf8/t1/t1 ,FORMAT RELEASE 12.3
rmttrail /home/oggtest3/base/dirdat/t1/t1 ,FORMAT 12.3
> unregister extract ext_t1 database
> register extract ext_t1 database CONTAINER(pdbodb)
OGG-01232 Receive TCP params error: TCP/IP error 104 (Connection reset by peer), endpoint:
> alter EXTRACT DP_T3,etrollover
抽取进程、投递进程均进行版本降级处理! 抽取进程遇到600无处理方法,删除重建进程重新注册;
投递进程投递写入可能需要使用参数重新写入,版本修改后,写入的文件可能需要重新覆盖写入目标端
需要alter 指定使用版本后的文件,否则默认还是使用之前老的版本,则报错 ERROR OGG-02598 File /home/oggtest3/base/dirdat/t1/t1000000000, with trail format release LEVEL 7, is not compatible
with the current software version‘s trail file format release RELEASE 12.3. Modify the file writer‘s parameter file to
generate the
appropriate format using the FORMAT RELEASE RELEASE 12.3 option. GGSCI (t1) 9> alter REPLICAT rep_t3,extseqno 1,extrba 0
4.4 Source Db 10.2.0.5 Ogg 11.1 toTarget Db19.2 Ogg 19.1
复制进程参数需要使用 assumetargetdefs 否则可能会报OGG-00423
OGG可以正向传输!!! 低版本->高版本,没啥子问题,没毛病!
五、OGG Trail文件从6位转换为9位,我们需要注意些什么,什么版本引入的改变?
5.1) OGG什么版本Trail文件位数转换为9位?
ogg11.1 t1000000 ogg19.1 ta000000000 Goldengate Replicat Process Abending With ERROR OGG-01332 File <filename>, with compatibility level 6, is not compatible
with the current software version‘s compatibility level of 4 (Doc ID 2538448.1) Oracle GoldenGate - Version 12.1.2.1.0 to 18.1.0.0.0 [Release 12.1 to 12.2] Goldengate Replicat Process Abending With ERROR OGG-01332 File <filename>, with compatibility level 6, is not compatible
with the current software version‘s compatibility level of 4 CAUSE Customer was using lower target OGG version than source OGG version This error can occur for any OGG version if target OGG version is lower than source , only compatibility value will change
for different OGG versions SOLUTION Please add FORMAT RELEASE parameter in extract or pump Additionally if target OGG version is 12.1 or prior , please add TRAIL_SEQLEN_6D parameter in GLOBALS file of source GGSCI ,
logout/login of ggsci , restart manager and re-create extract / pump process
这篇文档告诉了我们,第一确认了上述第四部分,OGG目标端比源端OGG版本低的情况下,源端必须降低版本到目标端相同的版本,才能进行复制使用! 反向低到高不存在啥子问题!
另外一个特性就是OGG12.1以及它之前,抽取的位数还是6位! 如果要给12.1以及更早版本OGG使用,除了降低版本兼容性之外! 还需要全局参数添加!
TRAIL_SEQLEN_6D 已确保,抽取进程抽取的位数使用6位!!!
5.2) OGG12.1 ->OGG12.2 复制进程不报错但是不同步数据!
Replicat checkpoint shows 9 digit trail file instead of 6 digits when source OGG version is 12.1.x and target
OGG version is 12.2.x (Doc ID 2120995.1) SYMPTOMS On : 12.2.0.1.0 version, 1 - Oracle DB backend ACTUAL BEHAVIOR --------------- Replicat is running but not applying any data when replicat from source OGG version 12.1.2.0.x to 12.2.0.x EXPECTED BEHAVIOR ----------------------- Replicat is running but not applying any data to target side. CAUSE This is caused due to following setup : Source is 12.1 and target is 12.2. Pump generate 6 digit trail seqno and
replicat was configured to use 9 digit. When source is 12.1 and target is 12.2. When adding the replicat, the checkpoint should be take 6 digit trail file. SOLUTION 1. edit params ./GLOBALS --Add the following parameter and save the file TRAIL_SEQLEN_6D 2. stop mgr 3. exit 4. ggsci>start mgr 5. dblogin userid , password 6. Add the replicat ADD REPLICAT <replicat_name> EXTTRAIL /bscs_dumps/oracle/ggtrails/dirdat/bt ,checkpointtable ggadmin.checkpoint. The above command will make the replicat to start from seqno 0 and RBA 0. If seqno is not available, you may need to
alter the replicat to least available seqno. Eg: If the trail file available is bt000001, then you need to alter the
replicat like the following dblogin userid , password alter replicat <replicat_name>, extseqno 1, extrba 0 NOTE: Customers running GoldenGate for Teradata may need to perform the same steps a couple of times before it works. If steps do not work the first time then logout ggsci prompt, enter ggsci prompt, execute steps above again and check
point accepts6 digit trail file. NOTE:1232303.1 - Oracle GoldenGate Best Practice: NFS Mount options for use with GoldenGate
正常情况下,OGG源端低版本,OGG目标端高版本应用是没有任何问题对吧?
但是12.1=>12.2 ogg是,复制进程不报错,但是不应用数据! 什么原因呢? 12.1抽取的文件格式6位,12.2OGG版本识别的文件是Trail 9位!
解决办法就是目标端12.2 OGG mgr进程编辑参数,降低自己识别的位数!TRAIL_SEQLEN_6D
5.3)关于位数问题,我们需要关注什么?
第一、对于12.1->12.2 ogg的同步需要参考MOS;
第二、由于4部分进行了测试11.1 ogg ->19.1 ogg同步无异常! 因此可以说明Oracle在较高的版本已经自己修复了这个位数不同导致,低->高版本不兼容的问题!
第三、基于上述情况,只要不报错就不处理!
低到高,目标端高版本的OGG软件,global参数设置降低为6位,应用trail文件!
高到低,源端设置global,降低为6位进行抽取及投递,目标端低版本本身就是6位无需调整;