日期:2014-05-16  浏览次数:20452 次

【Oracle】创建用于测试的大表

个人实验的时候有时会用到一些大表,在此分享用dba_objects来创建测试大表的方法:

首先建立测试表

SYS@ORCL>create table test nologging as select rownum id,a.* from dba_objects a where 1=2;

 

Table created.

插入500万条数据:

SYS@ORCL>declare

  l_cnt number;

  l_rows number:=&1;

begin

  insert /*+ append */ into test select rownum,a.* from dba_objects a;

  l_cnt:=sql%rowcount;

  commit;

  while(l_cnt<l_rows)

  loop