[英]Insert and update 4 million records everyday
審計目的,我想在一張表中插入100萬條記錄
並再次將 100 萬條記錄放入另一個表中。
並更新事務表(生產數據庫)中的 100 萬條記錄,並再次更新
更新另一個事務表(生產數據庫)中的 100 萬條記錄。
所以超過所有40M記錄。 等待資源時檢測到錯誤 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;
在每次操作后提交。
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.