首页 > 数据库 > Oracle > goldengate目标端报ORA-04098错误
1 OGG进程状态
GGSCI (osxxa) 13> info REPZB
REPLICAT REPZB Last Started 2021-04-09 08:42 Status ABENDED
Checkpoint Lag 09:00:44 (updated 00:02:01 ago)
Log Read Checkpoint File ./dirdat/zb019186
2021-04-08 23:41:54.000681 RBA 22638774
2 查看报错信息
2021-04-09 09:30:30 WARNING OGG-01003 Repositioning to rba 19471136 in seqno 19187.
2021-04-09 09:30:31 WARNING OGG-01154 SQL error 4098 mapping usera.USERA_TABLE to usera.USERA_TABLE OCI Error ORA-04098: trigger 'usera.USERAXX_TRIGGER' is invalid and failed re-validation (status = 4098). INSERT INTO "usera"."USERA_TABLE" ("UNIT_NO","UNIT_ID"..."Z00HRBMSS") VALUES (:a0,:a1。。。:a30).
2021-04-09 09:30:31 WARNING OGG-01003 Repositioning to rba 19923213 in seqno 19187.
Source Context :
SourceModule : [er.errors]
SourceID : [/scratch/pradshar/view_storage/pradshar_pse_15852019/oggcore/OpenSys/src/app/er/errors.cpp]
SourceFunction : [take_rep_err_action]
SourceLine : [623]
ThreadBacktrace : [8] elements
: [/ogg/libgglog.so(CMessageContext::AddThreadContext()+0x1e) [0x7fcff95b571e]]
: [/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...)+0x2cc) [0x7fcff95ae6bc]]
: [/ogg/libgglog.so(_MSG_ERR_MAP_TO_TANDEM_FAILED(CSourceContext*, ggs::gglib::ggapp::CQualDBObjName<(DBObjType)1> const&, ggs::ggli
b::ggapp::CQualDBObjName<(DBObjType)1> const&, CMessageFactory::MessageDisposition)+0x53) [0x7fcff95aa581]]
: [/ogg/replicat(take_rep_err_action(short, int, char const*, extr_ptr_def*, __std_rec_hdr*, char*, file_def*, bool)+0xdac) [0x521a8
0]]
: [/ogg/replicat(process_extract_loop()+0x2388) [0x53ad18]]
: [/ogg/replicat(main+0x732) [0x54cbd2]]
: [/lib64/libc.so.6(__libc_start_main+0xfd) [0x31b621ed1d]]
: [/ogg/replicat(__gxx_personality_v0+0x31a) [0x4c0c6a]]
2021-04-09 09:30:31 ERROR OGG-01296 Error mapping from usera.USERA_TABLE to usera.USERA_TABLE.
3 查看Oracle的官方文档
Oracle Golden Gate Replicat Abends With "OCI Error ORA-04098 Trigger Is Invalid And Failed Revalida (Doc ID 1621946.1)
Replicat is abending with the following
2014-01-28 11:30:16 WARNING OGG-01004 Oracle GoldenGate Delivery for Oracle, <replicat_name>.prm: Aborted grouped transaction on '<owner>.<table_name>', Database error 4098 (OCI Error ORA-04098: trigger '<trigger_name>' is invalid and failed re-validation (status = 4098). UPDATE <SQL Query failing>).
2014-01-28 11:30:16 WARNING OGG-01003 Oracle GoldenGate Delivery for Oracle, <replicat_name>.prm: Repositioning to rba 1392 in seqno 10.
The triggers are invalid-- This could be verified with the following statement:
select object_name
from dba_objects
where object_type = 'TRIGGER'
and status = 'INVALID';
In general, the Triggers must be disabled on Oracle target tables.
The work performed by triggers during its session could be disabled by the usage of the parameter DBOPTIONS SUPPRESSTRIGGERS
This is Supported for Oracle 10.2.0.5 and later patches to 10.2.0.5, and for Oracle 11.2.0.2 and later 11gR2 versions
This parameter causes Replicat to disable the work performed by triggers during its session. It does not disable a trigger, but instead prevents the trigger body from executing.
The WHEN portion of the trigger must still compile and execute correctly to avoid database errors.
4 根据Doc ID 1621946.1 文档,增加OGG参数(DBOPTIONS SUPPRESSTRIGGERS),在OGG会话级别禁用触发器
重启进程,OGG进程还是不能启动。
GGSCI (osxxa) 59> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT ABENDED REPZB 09:02:47 00:21:35
5 查看数据库的触发器,发现状态为invalid,是禁用的,但为什么OGG还是报错
SQL> col object_name for a40
SQL> select o.OWNER,o.OBJECT_NAME,o.status from dba_objects o where o.OBJECT_TYPE='TRIGGER' and o.status='INVALID';
OWNER OBJECT_NAME STATUS
------------------------------ ---------------------------------------- -------
usera USERAXX_TRIGGER INVALID
咨询业务系统人员,此触发器他们在创建时就一直报错,无法编译。故怀疑虽然触发器的状态为invalid,但有可能还有其它视图或相关的SQL没有禁用,故使用数据库命令禁用触发器。
SQL> alter trigger usera.USERAXX_TRIGGER disable;
Trigger altered.
6 启动OGG进程,OGG恢复正常。
REPLICAT RUNNING REPZB 00:00:00 00:00:01
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69996316/viewspace-2767375/ ,如需转载,请注明出处,否则将追究法律责任。