oracle中表、主键、索引都有存贮数属性,
tablespace TTTS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
索引它们都是被实实在在存在磁盘中。而外键、视图等都没有存贮属性,只是被记录在oracle的后台表中而已。
-- Create table
create table CERTTYPE
(
CERTTYPEID NUMBER(3) not null,
CERTTYPENAME VARCHAR2(30) not null,
RIGHTTYPEID NUMBER(3),
CERTPRENAME VARCHAR2(20),
CERTPRENAMESOURCE VARCHAR2(200),
CERTPRENAMESUFFIX VARCHAR2(20),
CERTPOSTWORDSOURCE VARCHAR2(200),
CERTPOSTWORDSUFFIX VARCHAR2(20),
CERTPOSTIDPREFIX VARCHAR2(20),
CERTPOSTIDSOURCE VARCHAR2(200),
CERTPOSTIDCODERULE NUMBER(1) default 1 not null,
CERTPOSTIDLENGTH NUMBER(2) default 6 not null,
CERTPOSTIDSUFFIX VARCHAR2(20),
PARENTCERTTYPEID NUMBER(3),
CERTPOSTIDSTARTID NUMBER(12) default 1 not null,
READONLY NUMBER(1) default 0 not null
);
-- Create/Recreate primary, unique and foreign key constraints
alter table CERTTYPE
add constraint PK_CERTTYPE primary key (CERTTYPEID);
alter table CERTTYPE
add constraint FK_CERTTYPE_RIGHTTYPE foreign key (RIGHTTYPEID)
references RIGHTTYPE (RIGHTTYPEID);
alter table CERTTYPE
add constraint FK_CERTTYPE_SELF foreign key (PARENTCERTTYPEID)
references CERTTYPE (CERTTYPEID) on delete set null;
-- Create/Recreate indexes
create index IDX_CERTTYPE_PARENTCERTTYPEID on CERTTYPE (PARENTCERTTYPEID);
create index IDX_CERTTYPE_RIGHTTYPEID on CERTTYPE (RIGHTTYPEID);