如何在oracle中从远程数据库本地插入CLOB数据类型列值

时间:2015-04-20 08:05:47

标签: xml oracle stored-procedures remote-access clob

我正在使用数据库链接从远程数据库执行数据提取到我的本地数据库。提取适用于其他远程数据库表但是当我尝试插入从远程数据库SOAP_MONITORING @ FONIC_RETAIL表中获取数据并尝试插入本地数据然后我得到一个错误:

EXCEPTION START EXT_SOAP_MONITORING 20.04.15 09:16:02,070559000 +02:00
EXCEPTION ORA-03113: end-of-file on communication channel
ORA-02063: preceding
line from FONIC_RETAIL
ERROR CODE-3113

ERROR:
ORA-00600: internal error code, arguments: [729], [33464], [space leak], [],
[], [], [], [], [], [], [], []

这是我面临的严重问题,并没有找到任何方法。 SOAP_MONITORING@FONIC_RETAIL具有REQUEST_XML,RESPONSE_XML列,其中包含大的xml字符串值,并且具有CLOB数据类型。我认为问题是由于这两列,因为它是clob数据类型并包含大型xml字符串,并且clob在使用远程数据库时遇到问题。SOAP_MONITORING@FONIC_RETAIL包含ID列,它是序列生成的并且我保存了CAPTURING表中的最大ID,然后在下次提取15分钟的调度作业时间,我得到ID大于上次保存的ID的数据。 这是我的程序:

PROCEDURE "EXT_SOAP_MONITORING" AS 
LAST_SM_ID Number := 0;

BEGIN

--DELETE DATA FROM TEMP_SOAP_MONITORING
EXECUTE IMMEDIATE 'TRUNCATE TABLE TEMP_SOAP_MONITORING';

-- first retrieve the last id (of the newest record) which has been imported at last extraction
SELECT LAST_TASK_ID INTO LAST_SM_ID FROM CAPTURING where DB_TABLE='TEMP_SOAP_MONITORING';

-- retrieve all new records from remote SOAP_MONITORING@FONIC_RETAIL and insert it into TEMP_SOAP_MONITORING using MERGE statement
-- MERGE statement is able to retrieve CLOB fields:

merge into TEMP_SOAP_MONITORING TSM
using (
   select * from
(select DISTINCT(ID),REQUEST_XML,RESPONSE_XML,WEB_SERVICE_NAME,WEB_METHOD_NAME,CREATE_DATE,ERROR_CODE,ERROR_MESSAGE from 
SOAP_MONITORING@FONIC_RETAIL WHERE WEB_SERVICE_NAME='RatorWebShopService' and WEB_METHOD_NAME='placeShopOrder' and ID > LAST_SM_ID order by ID desc) where rownum <=1000
) data
ON (TSM.ID = data.ID)
when not matched then
insert(ID,REQUEST_XML,RESPONSE_XML,WEB_SERVICE_NAME,WEB_METHOD_NAME,CREATE_DATE,ERROR_CODE,ERROR_MESSAGE)
values(data.ID,data.REQUEST_XML,data.RESPONSE_XML,data.WEB_SERVICE_NAME,data.WEB_METHOD_NAME,data.CREATE_DATE,data.ERROR_CODE,data.ERROR_MESSAGE);


-- Set the newest extracted ID as LAST_TASK_ID for TEMP_SOAP_MONITORING in the Capturing table
update
CAPTURING set LAST_TASK_ID= 
CASE WHEN (SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL THEN LAST_TASK_ID + 1 ELSE (SELECT MAX(ID) from TEMP_SOAP_MONITORING) END,
CAPTURING_DATE = CURRENT_TIMESTAMP where DB_TABLE='TEMP_SOAP_MONITORING';

-- Extract SUBSCCRIPTION_ID,  ORDER_NUMBER and ORDER_TYPE from XML (CLOB) fields and store it separately in TMP_SOAP_MONITORING_IDS table:

-- first delete the last extraction data
DELETE FROM TMP_SOAP_MONITORING_IDS WHERE CREATE_DATE < SYSDATE - 7;

COMMIT;  
END EXT_SOAP_MONITORING;

1 个答案:

答案 0 :(得分:1)

正如Rene所述,您应该联系Oracle支持部门和/或阅读一些与此错误相关的支持文档。它可能是一个可以解决的错误 通过升级