OGG-01028错误处理

OGG抽取进程报错如下:
ERROR   OGG-01028  encountered commit SCN 3090.2667129739 (13274116074379) that is not greater than the highest
SCN already processed 3090.2667130101 (13274116074741) Redo Thread 2 (2) xid 18.24.28309117 (0x0012.0018.01aff67d), starting seq.rb
a 3509.60173328, scn 3090.2667129738 (13274116074378), commit seq.rba 3509.60174196 commit timestamp 2013-03-18 22:02:35.000000.

GGSCI (nhdb16) 16>  info ESCDB002

EXTRACT    ESCDB002  Last Started 2013-03-19 11:03   Status ABENDED
Checkpoint Lag       00:00:02 (updated 11:24:37 ago)
Log Read Checkpoint  Oracle Redo Logs
                     2013-03-19 21:28:38  Thread 1, Seqno 4735, RBA 21603584
Log Read Checkpoint  Oracle Redo Logs
                     2013-03-19 21:28:54  Thread 2, Seqno 3585, RBA 50791440

-rw-rw-rw-    1 oracle   oinstall    9999525 Mar 20 16:36 esc00019
-rw-rw-rw-    1 oracle   oinstall    7943251 Mar 20 18:55 esc00020

Solution Details:
1. Do an ETROLLOVER on Extract, and take note of the new sequence number of the trail file.
ALTER EXTRACT ESCDB002, ETROLLOVER

2. Start extract
START EXTRACT ESCDB002

GGSCI (nhdb16) 76> info ESCDB002

EXTRACT    ESCDB002  Last Started 2013-03-21 15:05   Status RUNNING
Checkpoint Lag       20:10:38 (updated 00:00:08 ago)
Log Read Checkpoint  Oracle Redo Logs
                     2013-03-20 18:54:46  Thread 1, Seqno 4791, RBA 18211856
Log Read Checkpoint  Oracle Redo Logs
                     2013-03-20 18:55:00  Thread 2, Seqno 3661, RBA 87376180

3. Send PUMP, LOGEND, to see if it's at the end of the previous trail.
SEND EXTRACT PNFHC002, LOGEND

4. Once it is at the end of the trail file, You must stop the pump, and do an ETROLLOVER for it too. Take note of the new trail file sequence number that is created from this step.
STOP EXTRACT PNFHC002
ALTER EXTRACT PNFHC002, ETROLLOVER

GGSCI (nhdb16) 80> info PNFHC002

EXTRACT    PNFHC002  Initialized   2013-03-20 14:35   Status STOPPED
Checkpoint Lag       00:00:00 (updated 00:00:11 ago)
Log Read Checkpoint  File /gglog/dirdat/enfzh002/esc00020
                     2013-03-20 18:54:47.000000  RBA 7943251

2013-03-20 14:17:30  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.
EXTRACT altered.

[nhdb25:oracle]ls -la
total 0
drwxr-xr-x    2 oracle   oinstall        256 Mar 20 21:29 .
drwxr-xr-x   12 oracle   oinstall       4096 Mar 14 16:53 ..
-rw-rw-rw-    1 oracle   oinstall   47937377 Mar 20 18:55 rsc0004

5. Alter the pump to SEQNO to the new trail file created from step #1.
ALTER EXTRACT PNFHC002, EXTSEQNO 21 EXTRBA 0

6. Restart pump
START EXTRACT PNFHC002

7. Send Replicat, LOGEND to make sure it has processed all the remaining data, and stop Replicat.
SEND REPLICAT RSCDB002, LOGEND
STOP REPLICAT RSCDB002

8. If replicat is not at end of trail, generate a report and forcestop replicat
SEND REPLICAT RSCDB002, REPORT
STOP REPLICAT RSCDB002

9. Add the following parameters to replicat parameter file to allow replicat to process each trail record as a single transaction, or set them to 1 if you have any of these parameters:
GROUPTRANSOPS 1
MAXTRANSOPS 1

10. Restart replicat
START REPLICAT RSCDB002

11. Once replicat has completely processed the trail, stop the replicat
STOP REPLICAT RSCDB002

12. Edit the replicat parameter file:
     - Add parameter HANDLECOLLISIONS to Replicat parameter file
     - Remove or comment out GROUPTRANSOPS and MAXTRANSOPS or revert them back to their original values.

Note: There are pre-conditions for using  HANDLECOLLISIONS . Ther emust be either

a. no pkupdates
or
b. extract  has "FETCHOPTIONS FETCHPKUPDATECOLS"Also all the tables should have Primary key or unique index on the table to avoid data integrity issues when using handlecollisions.

13. ALTER REPLICAT, SEQNO to the new trail file created in step #4.
ALTER REPLICAT RSCDB002, EXTSEQNO 5 EXTRBA 0

14. Start Replicat
START REPLICAT RSCDB002

15. Once Replicat has processed the out of order SCN operations, disable HANDLECOLLISIONS. You could also look for the CSN and wait for Replicat to checkpoint past it.
SEND REPLICAT RSCDB002, NOHANDLECOLLISIONS.

16.Edit the replicat parameter and comment out the HANDLECOLLISIONS parameter. You do not need to stop/restart replicat. This will ensure that on any subsequent replicat restarts the parameter is disabled.

根据oracle给出的文档,测试参数如下:
THREADOPTIONS MAXCOMMITPROPAGATIONDELAY 60000 IOLATENCY 90000

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

转载于:http://blog.itpub.net/29468144/viewspace-1079330/

### 关于OGG-08221错误的解决方案 OGG-08221 错误通常发生在 Oracle GoldenGate 的 Replicat 进程中,当目标数据库无法解析源数据中的某些字段或列时会触发此错误。这种问题可能由多种原因引起,例如表结构不一致、字符集差异或者目标端缺少必要的权限。 以下是针对该问题的具体分析和解决方法: #### 1. **确认表结构一致性** 需要验证源端和目标端之间的表定义是否完全匹配。如果存在任何字段名称、数据类型或长度上的差异,则可能导致 OGG-08221 错误。可以通过比较 DDL 脚本来识别这些差异[^1]。 使用以下 SQL 查询来对比源端和目标端的表结构: ```sql SELECT column_name, data_type, data_length, nullable FROM user_tab_columns WHERE table_name = 'YOUR_TABLE_NAME'; ``` #### 2. **检查字符集兼容性** 如果源端和目标端使用的字符集不同,可能会导致数据转换失败并引发 OGG-08221 错误。建议通过查询 `NLS_CHARACTERSET` 参数来核实两端的字符设置是否相同[^2]。 可以运行如下命令获取当前实例的字符集配置: ```sql SELECT parameter, value FROM nls_database_parameters WHERE parameter LIKE '%CHARACTERSET%'; ``` #### 3. **验证目标用户的权限** 确保用于执行 Replicat 的用户拥有足够的权限操作目标表。特别是对于涉及 LOB 数据类型的场景,额外的权限可能是必需的。如果没有适当授权,也可能造成此类异常行为[^3]。 授予必要权限的例子包括但不限于: ```sql GRANT INSERT, UPDATE, DELETE ON your_schema.your_table TO replicat_user; ALTER USER replicat_user QUOTA UNLIMITED ON users; -- 若存储临时文件需空间配额 ``` #### 4. **调整GoldenGate参数配置** 对于复杂的数据类型(如 CLOB/BLOB),可以尝试修改 `.prm` 文件内的处理选项以更好地适应特殊情况下的数据流传输需求。比如启用 `ASSUMETARGETDEFS` 或者指定更详细的映射规则[^4]。 示例参数设定片段: ```plaintext ASSUMETARGETDEFS MAP source_schema.source_table, TARGET target_schema.target_table, COLMAP (USEDEFAULTS); ``` #### 5. **日志审查与调试模式开启** 启用更高的跟踪级别可以帮助定位具体哪条记录引发了冲突,并进一步缩小排查范围。增加日记详细程度可通过编辑进程控制文件实现,添加类似下面这样的指令即可: ```plaintext REPORTCOUNT EVERY 1 MINUTES DEBUG ERRORS TRACE ``` --- ### 总结 综合以上几点措施,应该能够有效应对大多数情况下出现的 OGG-08221 错误现象。实际应用过程中还需结合具体的业务环境灵活运用上述策略。 ```python def check_ogg_error(): """模拟函数:检测并修复OGG错误""" errors = ["OGG-08221", "OGG-01264", "OGG-00324"] solutions = { "OGG-08221": "Check table definitions and character sets.", "OGG-01264": "Review LOB handling configurations.", "OGG-00324": "Validate auto-restart settings." } for err in errors: print(f"Error {err}: Solution -> {solutions.get(err)}") ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值