分类: Oracle
2010-02-10 01:42:37
假定表里面已经有一些数据了,现在要通过存储过程来让已有的数据不停的翻番,已造出大量的数据
CREATE OR REPLACE PROCEDURE "INSERTDATA"
AS
distance int;
BEGIN
distance := 0;
loop
INSERT INTO user.table
(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO, TEST)
SELECT EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO, TEST
FROM user.table;
exit when distance > 4;
distance := distance + 1;
end loop;
commit;
END;
完了,可以查一下表的大小
select round(sum(bytes)/(1024*1024),2) from user_extents where segment_name = 'user.table';