b 表有 分区吗? 有分区的话 用分区可以添加并行处理 insert into table a select /*+parallel(b,6)*/ /*+append*/ * from table partition(part....) b ; --parallel(b,6) 后面的 6为并行处理的数量 通常和CPU 数量相同
create or replace procedure bulk_insert(in_bulk_count integer) is cursor cur is select * from b; type tbl_b is table of b%rowtype index by pls_integer; v_tbl_b tbl_b; begin open cur; loop <<bulk_insert>> exit when cur%notfound; fetch cur bulk collect into v_tbl_b limit in_bulk_count; forall i in indices of v_tbl_b save exceptions insert /*+append*/ into a values v_tbl_b(i); commit; exception when others then null; end loop bulk_insert; close cur; end;
没有分区 你下面写的语句是根据分区来的吗? 我的处理方式是 用查询条件将表分成了129个表,然后挨个insert into table as select * from b_i; 方法虽然笨了点,好歹可行。。:)
有分区的话 用分区可以添加并行处理 insert into table a select /*+parallel(b,6)*/
/*+append*/
*
from table partition(part....) b ; --parallel(b,6) 后面的 6为并行处理的数量 通常和CPU 数量相同
is
cursor cur is select * from b;
type tbl_b is table of b%rowtype index by pls_integer;
v_tbl_b tbl_b;
begin
open cur;
loop
<<bulk_insert>>
exit when cur%notfound;
fetch cur bulk collect into v_tbl_b limit in_bulk_count;
forall i in indices of v_tbl_b save exceptions
insert /*+append*/ into a values v_tbl_b(i);
commit;
exception
when others then
null;
end loop bulk_insert;
close cur;
end;
你下面写的语句是根据分区来的吗?
我的处理方式是 用查询条件将表分成了129个表,然后挨个insert into table as select * from b_i;
方法虽然笨了点,好歹可行。。:)
insert /*+append*/ into a select * from b
parallel并行,
nologging不记日志