简体   繁体   English

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

[英]Insert and update 4 million records everyday

Auditing purpose, I want to insert 1 million records into one table审计目的,我想在一张表中插入100万条记录

and again 1 million record into another table.并再次将 100 万条记录放入另一个表中。

and update 1 million record in transaction table(production DB) and also again并更新事务表(生产数据库)中的 100 万条记录,并再次更新

update 1 million record in another transaction table(production DB).更新另一个事务表(生产数据库)中的 100 万条记录。

so over all 40M records.所以超过所有40M记录。 I am getting error ORA-00060 deadlock detected while waiting for resource.等待资源时检测到错误 ORA-00060 死锁。

actually I cant give commit in between the transaction.实际上我不能在交易之间做出承诺。 after completed the task successfully I have to commit the transaction.成功完成任务后,我必须提交事务。 like example if I keep commit for each insert, any error occurs i cant rollback.例如,如果我为每个插入保持提交,任何错误都会发生我无法回滚。

I am new to oracle.我是 oracle 的新手。 Kindly advice.好心劝告。

Thanks in advance提前致谢

Flow流动

insert 1M插入 1M

insert 1M插入 1M

update 1M更新 1M

update 1M更新 1M

commit;犯罪;

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;

put commit after each operation.在每次操作后提交。

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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM