Oracle千万级数据处理
--插入时不产生日志,
--alter table cux_mtl_material_vmi2024038 nologging;
--记录时间
--set timing on;
declare cursor cur is select mmt.organization_id, mmt.subinventory_code, mmt.transaction_quantity, mmt.transfer_organization_id, mmt.transfer_subinventory, mmt.owning_organization_id, mmt.xfr_owning_organization_id, mmt.inventory_item_id, mmt.transaction_id, mmt.transaction_date, sysdate -- mmt.creation_date from mtl_material_transactions mmt where mmt.transaction_type_id = 74 and mmt.owning_organization_id in (select org.organization_id from org_organization_definitions org); type rec is table of cux_mtl_material_vmi2024038%rowtype; recs rec; begin open cur; while (true) loop --//批量提交控制(每100w提交一次) fetch cur bulk collect into recs limit 1000000; --//捆绑插入(减少与服务器交互的次数) forall i in 1 .. recs.count insert /*+ append(6) */ into cux_mtl_material_vmi2024038 values recs(i); commit; exit when cur%notfound; end loop; close cur; end;
本文来自博客园,作者:Iven_lin,转载请注明原文链接:https://www.cnblogs.com/ivenlin/p/18081507
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了