如何随机生成一个大表的数据

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-1 19:10   66   0
create table test_table(a number,b varchar2(100),c varchar2(10),d date);
insert into test_table
select rownum as a,
dbms_random.string('a', 50),
dbms_random.string('u', 3) as c,
to_date('2016-01-01', 'yyyy-mm-dd') + dbms_random.value * 360 as d
from dual
connect by level <= 4000000;
commit;


创建索引:
create index idx_node_c_a on test_table(c,a);
create index idx_node_c on test_table(c);
create index uk_node on test_table(a);

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28869493/viewspace-2137418/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28869493/viewspace-2137418/

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP