-- 业务用户登录
conn jingyu/jingyu
-- 删除T1,T2两张表
drop table t1 cascade constraints purge;
drop table t2 cascade constraints purge;
-- 创建T1,T2两张表
create table t1( id number not null, n number, contents varchar2(4000) ) tablespace dbs_d_jingyu;
create table t2( id number not null, t1_id number not null, n number, contents varchar2(4000) ) tablespace dbs_d_jingyu;
-- 初始化向T1,T2表插入随机测试数据
execute dbms_random.seed(0);
set timing on
insert into t1 select rownum, rownum, dbms_random.string('a',50) from dual connect by level <= 100 order by dbms_random.random;
commit;
insert into t2 select rownum, rownum, rownum, dbms_random.string('b',50) from dual connect by level <= 100000 order by dbms_random.random;
commit;
-- 查询T1,T2表数据量
select count(1) from t1;
select count(1) from t2;