在存储过程中使用数据库链接抛出异常ORA-02063

时间:2016-08-18 13:07:29

标签: oracle

我创建了一个名为' MC_Link'的数据库链接。 使用该链接我将一些记录从Database1传递到Database2。 我正在使用该MC_Link插入至少100条记录,并在最后进行提交。

 Declare
    CURSOR c_arch
    IS
    SELECT EmpId FROM Employee WHERE update_dts < (SYSDATE-365) AND ROWNUM <= 100;
    Begin
    FOR i IN c_arch
        LOOP
    Insert into table1 (colum1,colum2) select colum1,colum2 from table1@MC_Link where EmpId=i.EMPId ;
    Insert into table2 (colum1,colum2) select colum1,colum2 from table2@MC_Link EmpId=i.EMPId ;
    Insert into table3 (colum1,colum2) select colum1,colum2 from table3@MC_Link
    EmpId=i.EMPId ;
    End LOOP;
    Commit;
    End;

我需要按批处理方式执行此操作,因此我已经给出了上面的rownum并且只使用了一次提交。

首先它运行正常,但现在我收到错误&#39; ORA-02049:超时:分布式事务等待锁定&#39;

任何人都可以帮我解决这个错误吗?我在这里缺少什么?

提前致谢..

0 个答案:

没有答案
相关问题