使用shell+procedure构造测试数据

more test.sh
#!/usr/bin/bash

export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client64/lib
/usr/lib/oracle/10.2.0.3/client64/bin/sqlplus renxp/[email protected]:1521/orcl <<EOF
delete from test_xhu
commit;
create or replace procedure xhu_proc is
begin
    for i in 1..5000 loop
      insert into test_xhu values(i,DBMS_RANDOM.STRING('U',2048));
    end loop;
    commit;
      insert into test_xhu values('100001','sadasfffasd');
      insert into test_xhu values('100002','gfhghfhhf');
      insert into test_xhu values('100003','kljnsdfsdf');
      insert into test_xhu values('100004','yitoyitouds');
      insert into test_xhu values('100005','gagsgadiuyf');
    commit;
end xhu_proc;
/
exec xhu_proc
exit;
EOF

猜你喜欢

转载自8366.iteye.com/blog/1354435