ogg无法正常停止extract进程 & 重启进程报错处理

在给ogg源端、目标端新增表时,经常会出现由于大事务的存在而导致抽取进程无法正常停止。系统会提示有大事务存在。

Sending STOP request to EXTRACT EXTODS3 ...

There are open, long-running transactions. Before you stop Extract, make the archives containing data for those transactions available for when Extract restarts. To force Extract to stop, use the SEND EXTRACT EXTODS3, FORCESTOP command.
Oldest redo log files necessary to restart Extract are:

Redo Thread 1, Redo Log Sequence Number 81638, SCN 3461.1538900652 (14866420712108), RBA 212382736
Redo Thread 2, Redo Log Sequence Number 106187, SCN 3461.1577312642 (14866459124098), RBA 824682512

由于本套环境的源端库比较繁忙,等到这个事务结束再去停止抽取进程,在参数表中配置,是无法忍受的,所以根据提示使用了强制停止抽取进程。

GGSCI (crm2db2) 2> SEND EXTRACT EXTODS3, FORCESTOP

在参数文件中添加好新表信息后,尝试重启进程,发现无法正常启动,进程状态为abended。
报错信息为无法找到归档日志(没有记录当时的日志,今后碰到会补充)

--解决办法:记录下问题进程的信息
GGSCI (crm2db2) 2> info EXTODS1

EXTRACT    EXTODS1   Last Started 2016-04-18 11:07   Status ABENDED
Checkpoint Lag       00:35:35 (updated 00:00:11 ago)
Log Read Checkpoint  Oracle Redo Logs
                     2016-04-18 10:41:35  Thread 1, Seqno 81166, RBA 26388520
                     SCN 3461.1066937545 (14865948749001)
Log Read Checkpoint  Oracle Redo Logs
                     2016-04-18 10:41:35  Thread 2, Seqno 105728, RBA 25264
                     SCN 3461.1066938115 (14865948749571)


---通过os层面kill extract进程
ogg_eda@crm2db2:/ogg_eda$ ps -ef|grep EXTODS1
 ogg_eda  9335 16252  0 11:07:34 ?         8:37 /ogg_eda/extract PARAMFILE /ogg_eda/dirprm/extods1.prm REPORTFILE /ogg_eda/dirrpt/EXTODS1.rpt PROCESSID EXTODS1 USESUBDIRS
 ogg_eda 12019 11708  0 11:16:53 pts/8     0:00 grep EXTODS1

kill -9 9335

--alter ogg  时间比 info EXTODS1的时间提前2s
ALTER EXTRACT EXTODS1, THREAD 1, BEGIN 2016-04-18 10:41:33       
ALTER EXTRACT EXTODS1, THREAD 2, BEGIN 2016-04-18 10:41:33 


--start extract
start  EXTODS1

之后检查目标端,可能会出现数据重复导入的问题,需要加入参数HANDLECOLLISIONS
问题现象: 对比表两边字段,未发生变化。只是出现重复数据

 view report REPQD3
 
MAP resolved (entry OM.L_OFFER_PROD_INST_REL):
  MAP "OM"."L_OFFER_PROD_INST_REL" , TARGET CRMPDATA.L_OFFER_PROD_INST_REL;
Using following columns in default map by name:
  PROD_COMP_ID, PRO_PROD_COMP_ID, PROD_COMP_ROLE_CD, PROD_INST_ID, 
  STATE_CD, CREATE_DATE, LAN_ID, INSTANCE_TYPE, INSTANCE_ID, 
  PROD_TYPE_CD, COMP_INST_ID, CHG_ID, CUST_ORDER_ID, ORDER_ITEM_ID, 
  ACTION_TYPE, STATE_DATE, END_TIME, BEG_TIME, STAFF_ID, CHANNEL_ID, 
  DETAIL_ID, MCOMP_INST_ID, OFFER_PROD_INST_REL_ID, PROD_OFFER_INST_ID, 
  ROLE_CD, OFFER_PROD_INST_REL_ROLE_ID, BILL_PROD_OFFER_INST_ID, 
  EFF_DATE, EXP_DATE, D_ORDER_ITEM_ID
Using the following key columns for target table CRMPDATA.L_OFFER_PROD_INST_REL: PROD_COMP_ID, ORDER_ITE
M_ID, ACTION_TYPE, CHG_ID.


2016-05-06 16:22:10  WARNING OGG-00869  OCI Error ORA-00001: unique constraint (CRMPDATA.PK_OFFER_PROD_I
NST_REL) violated (status = 1). INSERT INTO "CRMPDATA"."L_OFFER_PROD_INST_REL" ("PROD_COMP_ID","PRO_PROD
_COMP_ID","PROD_COMP_ROLE_CD","PROD_INST_ID","STATE_CD","CREATE_DATE","LAN_ID","INSTANCE_TYPE","INSTANCE
_ID","PROD_TYPE_CD","COMP_INST_ID","CHG_ID","CUST_ORDER_ID","ORDER_ITEM_ID","ACTION_TYPE","STATE_DATE","
END_TIME","BEG_TIME","STAFF_ID","CHANNEL_ID","DETAIL_ID","MCOMP_INST_ID","OFFER_PROD_INST_REL_ID","PROD_
OFFER_INST_ID","ROLE_CD","OFFER_PROD_INST_REL_ROLE_ID","BILL_PROD_OFFER_INST_ID","EFF_DATE","EXP_DATE","
D_ORDER_ITEM_ID") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8,:a9,:a10,:a11,:a12,:a13,:a14,:a15,:a16,:a1
7,:a18,:a19,:a20,:a21,:a22,:a23,:a24,:a25,:a26,:a27,:a28,:a29).

--之后在该进程参数文件中加入HANDLECOLLISIONS,之后重启。待数据追平后注释掉该参数,再次重启该进程,使得注释参数生效。
GGSCI (qdata-rac2) 31> edit param REPQD3
REPLICAT repqd3
setenv (ORACLE_SID=gsods2)
setenv (NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
USERID ogg,Password oEgDgA163CRM
REPORTCOUNT EVERY 30 MINUTES,RATE
REPERROR Default,ABEND
numfiles 5000
--HANDLECOLLISIONS
assumetargetdefs
DISCARDFILE ./dirrpt/repqdata3.dsc, APPEND, MEGABYTES 1024
ALLOWNOOPUPDATES
MAP OM.ACCESS_PROD_INST_XM , TARGET CRMPDATA.ACCESS_PROD_INST_XM;

之后进程恢复正常。

发表评论

电子邮件地址不会被公开。 必填项已用*标注