(1)创建表test01
create table test01 ( col1 number,col2 varchar2(30),col5 100) );
(2)创建自增序列
CREATE SEQUENCE seq01 START WITH 1 MAXVALUE 99999999 MINVALUE 0 CYCLE CACHE 10 ORDER;
(3)创建随机数据插入存储过程,其中col1列单调递增
create or replace procedure p_insert_test01 IS v_col1 NUMBER; BEGIN FOR i IN 1..10000 LOOP select seq01.nextval INTO v_col1 from dual; insert into test01(col1,col2,col3,col4,col5) values (v_col1,(select round(dbms_random.value(10000,100000000)) dual),sysdate,1)">select dbms_random.string('a',1); font-weight: bold">25) 85) dual)); END LOOP; commitend p_insert_test01;
(4)制定job,没隔30s执行一次上面的存储过程
declare job1 begin sys.dbms_job.submit(job => job1,what => p_insert_test01;' sysdate,interval sysdate + 30/(1440*60)'); --每隔30s向test01表插入10000笔随机数据 end; /
相关文档集合: 1.MySQL数据库创建随机测试数据 |