1、优化FP_BOM中第839行执行过慢问题,且会出现ORA-01652: 无法通过 128 (在表空间 STGTEMP 中) 扩展 temp 段ORA-06512: 在 "STG.FP_BOM", line 839
检查发现MST_BOMCOMPONENTS表中BOMID中没有空格,可以却除,另外增加索引
SELECT DISTINCT AM.SCENARIO_ID, AM.ENGINE_ID, AM.ENTERPRISE, AM.SITEID, AM.PROPERTY, CASE WHEN IC.OLD_ITEM_ID=AM.ITEM THEN IC.NEW_ITEM_ID ELSE AM.ITEM END AS ITEM, AG.BOMID, AG.ROUTINGID, AM.OPERATIONSEQ, AM.PHANTOM, 1 NEW_QUANTITY, AM.QTYUOM, AM.SATISFYDMDCOMPLETE, AM.COMPONENTGROUP, AM.EFFSTARTDATE, AM.EFFENDDATE, AM.YIELD, AM.SPLITPERCENT, 'AnDan' FROM IN_BOM_CHANGE IC JOIN ABPPMGR.MST_ITEMBOMROUTING AG ON IC.PARENT_ITEM_ID=AG.ITEM JOIN ABPPMGR.MST_BOMCOMPONENTS AM ON TRIM(AM.BOMID)=SUBSTR(AG.BOMID,1,INSTR(AG.BOMID,'_',1,4)-1) WHERE IC.ACTION='MODIFY' AND AG.SYS_CREATED_BY='AnDan';
create index ABPPMGR.idx_MST_BOMCOMPONENTS_DBA01 on ABPPMGR.MST_BOMCOMPONENTS(BOMID);
2、
SELECT DISTINCT AM.SCENARIO_ID, AM.ENGINE_ID, AM.ENTERPRISE, AM.SITEID, AM.PROPERTY, CASE WHEN IC.OLD_ITEM_ID=AM.ITEM THEN IC.NEW_ITEM_ID ELSE AM.ITEM END AS ITEM, AG.BOMID, AG.ROUTINGID, AM.OPERATIONSEQ, AM.PHANTOM, 1 NEW_QUANTITY, AM.QTYUOM, AM.SATISFYDMDCOMPLETE, AM.COMPONENTGROUP, AM.EFFSTARTDATE, AM.EFFENDDATE, AM.YIELD, AM.SPLITPERCENT, 'AnDan' FROM IN_BOM_CHANGE IC JOIN ABPPMGR.MST_ITEMBOMROUTING AG ON IC.PARENT_ITEM_ID=AG.ITEM JOIN ABPPMGR.MST_BOMCOMPONENTS AM ON TRIM(AM.BOMID)=SUBSTR(AG.BOMID,1,INSTR(AG.BOMID,'_',1,4)-1) WHERE IC.ACTION='MODIFY' AND AG.SYS_CREATED_BY='AnDan';
create index ABPPMGR.idx_MST_ITEMBOMROUTING_dba01 on ABPPMGR.MST_ITEMBOMROUTING(ITEM); create index ABPPMGR.idx_MST_ITEMBOMROUTING_dba02 on ABPPMGR.MST_ITEMBOMROUTING(BOMID); create bitmap index ABPPMGR.idx_MST_ITEMBOMROUTING_dba03 on ABPPMGR.MST_ITEMBOMROUTING(SYS_CREATED_BY);