You should tell more info about your question :)
I usually do like the following :
1.write a sh ( including insert sql , maybe 10 lines is enough );
2.create tabletmp as select * from tableaa; ( tableaa is the table you used for large data )
3.update tabletmp.....
4.insert into tableaa as select * from tableaa
5.drop tabletmp;
6.create tabletmp as select * from tableaa;
7.update tabletmp.....
8.insert into tableaa as select * from tableaa ( now you got 40 recs in tableaa )
repeat.....
a bit boring :)
I usually do like the following :
1.write a sh ( including insert sql , maybe 10 lines is enough );
2.create tabletmp as select * from tableaa; ( tableaa is the table you used for large data )
3.update tabletmp.....
4.insert into tableaa as select * from tableaa
5.drop tabletmp;
6.create tabletmp as select * from tableaa;
7.update tabletmp.....
8.insert into tableaa as select * from tableaa ( now you got 40 recs in tableaa )
repeat.....
a bit boring :)
create table TEST (
Account VARCHAR2(20) not null,-- 帐号
BillingDate DATE not null,-- 结算日期
PIN CHAR(32), -- 个人身份识别码
Amount NUMBER(10), -- 发生金额
Balance NUMBER(10), -- 余额
constraint TEST_PK primary key (Account, BillingDate)
)
/REM 创建数据
CREATE OR REPLACE PROCEDURE InsertTEST(
p_string VARCHAR2, -- 开始三个字母
p_rowNum NUMBER, -- 数据的总记录数
p_hisRow NUMBER -- 历史数据的个数
)AS
v_rowNum NUMBER;
v_hisRow NUMBER;
BEGIN
v_rowNum := 0;
WHILE v_rowNum < p_rowNum LOOP
v_hisRow := p_hisRow;
WHILE v_hisRow > -1 LOOP
INSERT INTO TEST
VALUES(p_string||to_char(v_rowNum,'fm0999999999999999'),add_months(sysdate, - v_hisRow),'PIN415646465897984546',60000,20010);
v_hisRow := v_hisRow - 1;
END LOOP; v_rowNum := v_rowNum + 1;
IF MOD(v_rowNum,40000)=0 THEN
commit;
END IF;
END LOOP;
END InsertTEST;
/
----------------
你想增加多少就看你了
exec InsertTest('ACC',100000,2);
test表就会有3000000条记录的。
在excel中写好所有的sql语句(excel可以复制吗),copy到sql/plus中执行