nCount number; nCount := 0; loop select count(*) into nCount from table1 where rownum < 100000; --判断循环退出 if nCount == 0 then exit loop; end if; --插入100000条 insert into table2 select * from table1 where rownum < 100000; --提交 commit; end loop;
参考: create table NewBackTable as select * from Oldtable
如果表里的数据在你操作期间不不变化的话。可以自己写个存储过程,order by rowid,循环处理。
nCount := 0;
loop
select count(*) into nCount from table1
where rownum < 100000;
--判断循环退出
if nCount == 0 then
exit loop;
end if;
--插入100000条
insert into table2
select * from table1
where rownum < 100000;
--提交
commit;
end loop;
create table NewBackTable as select * from Oldtable