提高delete效率方法

1 open c_1;
   loop
     fetch c_1 bulk collect
       into t2 limit 100000;
     exit when c_1%notfound;
     FORALL i IN 1 .. t2.count
       delete from a_wc_cb_cjcb where rowid = t2(i);
     commit;
   end loop;
   close c_1

 

2 for a in 1 .. 100 loop  
     t1 := t_1();
   end loop;
   select a bulk collect into t2 from a;
   FORALL t1_i IN 1 .. t2.count
     delete from a where a = t2(t1_i);

 

3 begin
    v_sql := 'alter table a_wc_cb_cjcb drop partition p' || v_value;
    execute immediate v_sql;
    commit;
  exception
    when others then
      null;
  end;
  v_sql := 'alter table a_wc_cb_cjcb add partition p' || v_value ||
           ' values(''' || v_value || ''') tablespace ts' || v_dwbm;
  execute immediate v_sql;
  commit;

转载于:https://www.cnblogs.com/sddychj/p/4606878.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值