Where The Streets Have No Name

Copy_t 생성 본문

Developement/DataBase

Copy_t 생성

highheat 2006. 4. 8. 15:04
create table copy_t (
    no            number(3) not null,
    vno           varchar(3) not null
)
pctfree    0
pctused    40
initrans   1
maxtrans   255
storage
(
initial 40 k
next    40 k
pctincrease 0
minextents 1
maxextents 121
)
tablespace users
;

create unique index copy_t_i00 on copy_t ( no asc )
pctfree 0
storage
(
initial 40 k
next 40 k
pctincrease 0
minextents 1
maxextents 121
)
tablespace indx
;

alter table copy_t add ( constraint copy_t_i00 primary key (no) using index);

create unique index copy_t_i01 on copy_t ( vno asc )
pctfree 0
storage
(
initial 40 k
next 40 k
pctincrease 0
minextents 1
maxextents 121
)
tablespace indx
;

insert into copy_t
select rownum no, to_char(rownum,'fm000') vno
from item -- 100 건 이상이 있는 테이블
where rownum<100;