0
我正在使用數據庫鏈接將數據從遠程數據庫中提取到本地數據庫中。其他遠程數據庫表的提取工作正常,但是當我嘗試插入到取從遠程數據庫SOAP_MONITORING @ FONIC_RETAIL表中的數據,並嘗試插入數據在本地,然後我得到一個錯誤:如何在本地從遠程數據庫中插入CLOB數據類型列值在oracle中
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], [],
[], [], [], [], [], [], [], []
這是嚴重的問題,我面臨的,並沒有發現任何與此方式。 [email protected]_RETAIL
有REQUEST_XML,RESPONSE_XML
列,其中包含大的xml字符串值,它有CLOB
數據類型。我認爲問題是因爲這2列,因爲它是clob數據類型,幷包含大型xml字符串,clob在使用遠程數據庫時有問題。[email protected]_RETAIL
包含ID列,它是序列生成的,我將最大ID保存在CAPTURING
表,然後在下一次提取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 [email protected]_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
[email protected]_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;
您最好諮詢Oracle支持站點。它有一些關於ORA-00600 [729]錯誤的文檔。 – Rene
我的提取用於SOAP_MONITORING @ FONIC_RETAIL表正常運行,但經過一段時間後,它會失敗並出現此類錯誤。你知道我可以在哪裏優化我的查詢嗎?它就像超時發生和數據庫連接失敗,因爲SOAP_MONITORING @ FONIC_RETAIL包含大型xml字符串,它是clob數據類型 – Andrew