-- Create sequence
create sequence SEQ_TABLE_A
minvalue 1
maxvalue 999999999999999999999999999
start with 3021
increment by 1
cache 20;
create table
tb(
ID NUMBER,
DOMAIN VARCHAR2(50),
IP LONG
) NOLOGGING ;
CREATE OR REPLACE PROCEDURE p_insert
IS
num NUMBER; --批量提交参数
BEGIN
num :=1;
FOR i IN 1..1000 LOOP
insert into tb(id,domain,ip) VALUES(SEQ_TABLE_A.NEXTVAL,'www.a_'||i||'.com',3232238953+(i-1)*10); --执行插入
num:=num+1;
IF Mod(num,100)=0 THEN --一百笔提交一次,分批量提交,及时释放redo log buffer
COMMIT;
END IF;
END LOOP;
END;