使用bulk collect insert实现大数据快速迁移
create table t_target (id number, owner varchar2(30), object_name varchar2(128), object_id number, xx date, yy varchar2(10) ) ?
declare type t_array is table of t_target%rowtype; t_data t_array; cursor c is select null id, owner, object_name, null object_id, null xx, null yy from dba_objects;begin open c; loop fetch c bulk collect into t_data limit 100; forall i in 1 .. t_data.count insert into t_target values t_data (i); exit when c%notfound; end loop; close c; commit;end; ?
?
?