ITeye博客

使用shell+procedure构造测试数据

8366 · 2012-01-17 15:27 · DB · 数据库 · Markdown

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/renxp@172.17.18.164: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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。