一、问题
1、问题描述
外网可以查询访问,内网无法查询访问。提示:
2、查看语句
select pm.IND_CODE 设备编号, case when pm.BUFFER30 = '1' then A.RUNTIME_EQ else B.RUNTIME_FILE end 开机时间, '0' 开机率, PM.IND_CODE 设备编号, PM.IND_Name 设备名称, pm.buffer21 部门名称 from MES_PM_MASTERDATA pm left join (SELECT ROUND(SUM((TO_DATE(A.REC_DATE, 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(A.BUFFER1, 'YYYY-MM-DD HH24:MI:SS')) * 24), 2) as RUNTIME_EQ, B.Eq_Code FROM MES_DC_CT_EQ A INNER JOIN MES_DC_EQPARAM B ON A.CPN_CODE = B.CPN_CODE AND B.ENABLEFLAG = 'Y' AND B.IS_VALID = 'Y' WHERE A.ENABLEFLAG = 'Y' AND A.REC_VALUE = '1' and (TO_DATE(A.REC_DATE, 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(A.BUFFER1, 'YYYY-MM-DD HH24:MI:SS')) * 24 * 60 < 10 AND A.BUFFER1 IS NOT NULL AND A.CREATEDATE >= TO_DATE('2023/8/1 0:00:00', 'YYYY-MM-DD HH24:MI:SS') AND A.CREATEDATE <= TO_DATE('2023/8/31 23:59:59', 'YYYY-MM-DD HH24:MI:SS') group by B.Eq_Code) A on pm.IND_CODE = A.EQ_CODE LEFT JOIN (SELECT NVL(ROUND(SUM((TO_DATE(A.JBC56, 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(A.JBC55, 'YYYY-MM-DD HH24:MI:SS')) * 24), 2), 0) as RUNTIME_FILE, A.JBC51 FROM APLJBG A WHERE A.JBC02 = '4' AND A.JBC56 >= '2023-08-01 00:00:00' AND A.JBC56 <= '2023-08-31 23:59:59' group by A.JBC51) B ON pm.IND_CODE = B.JBC51 where (pm.IND_OBJ_TYPE IN ('1000205001', '1000205002', '1000205003', '1000205004') OR pm.BUFFER57 IN ('ZCZ1201', 'ZCZ1301', 'ZCZ3004', 'ZCZ2409')) AND pm.IND_STATUS = '10' AND pm.ENABLEFLAG = 'Y'
2、查询时间
3、查询计划
4、最终经查看应用
外网和内网走的路线不同;
内网是直接连数据库,外网通过webservice获取。其中分别有timeout设置,外网设置300s,内网默认15s,因为查询量大时查询时间会超过15s,所以会提示ora-001010的错误