每天插入和更新400万条记录

审核目的,我想在一张表中插入100万条记录

再将100万条记录插入另一个表。

并更新交易表(生产数据库)中的100万条记录,并再次更新

在另一个交易表(生产数据库)中更新100万条记录。

因此涵盖了所有4000万条记录。我在等待资源时收到错误ORA-00060死锁。

实际上,我不能在事务之间进行提交。成功完成任务后,我必须提交事务。像示例,如果我为每个插入保留提交,则将发生任何错误,我无法回滚。

我是oracle新手。请指教。

预先感谢

流量

插入1M

插入1M

更新1M

更新1M

提交;

Create or replace procedure prc_tagbalance
As
Begin
  Insert into t1 
  Select custid,mobileno,openingbal,currentvalue
  From mas_walletinfo;
Exception
  -- Error table insert using procedurr with pragma Autonomous transaction
  Return;
End;

Begin
  Insert into t2
    Select vechileid,tid,tbalance from mas_vehicleinfo;
Exception
  --error table insert
  Return;
End;

Begin
  Update mas_walletinfo set openingbal=currentvalue;
Exception
  Return;
End;
Begin
  Update mas_vechileinfo set openingbal=tbalnce:
  Commit;
Exception
  Return;
End:
End;
imaginechina 回答:每天插入和更新400万条记录

每次操作后提交提交。

Create or replace procedure prc_tagbalance
As
Begin
  Insert into t1 
  Select custid,mobileno,openingbal,currentvalue
  From mas_walletinfo;
 Commit;
Exception
  -- Error table insert using procedurr with pragma Autonomous transaction
  Return;
End;

Begin
  Insert into t2
    Select vechileid,tid,tbalance from mas_vehicleinfo;
 Commit;
Exception
  --error table insert
  Return;
End;

Begin
  Update mas_walletinfo set openingbal=currentvalue;
 Commit;
Exception
  Return;
End;
Begin
  Update mas_vechileinfo set openingbal=tbalnce:
  Commit;
Exception
  Return;
End:
End;
本文链接:https://www.f2er.com/3164877.html

大家都在问