Oracle建立聚簇表

建立聚簇表过程:并发

   建立簇(cluster)----建立簇表(基本相似建立通常表但有区别)----建立簇索引(index)----数据管理spa

建立簇:索引

create cluster stu_ach(sid number)事务

pctused 40            ---当数据少于40%,能够被insert,通常默认值为40%it

pcfree 10              ---为一个块保留空间的百分比,意思是在空间低于10%,不能再被insert,只能被用于updatetable

size 1024              ---表示每一个聚簇键关联大约1024个字节(一边的表一条数据足矣),Oracle会计算每一个块最多能放多少聚簇键sed

initrans 2              ---并发事务数为2(通常状况下设为1-4)date

maxtrans  255      ---最大并发事务数为255next

tablespace users               数据

storage(               ---包含‘()’中一系列参数

    initial 128k

    next 128k

    minextents 2

   maxextents 20

);

建立簇表

create table Student(

Sid number,

Sname varchar2(8),

Sage number

)

cluster stu_ach(sid);

 

create table achievement(

Aid number,

Score number,

Sid number

cluster stu_ach(sid);

 

建立簇索引

create index stu_ach_index on cluster stu_ach

tablespace users;

相关文章
相关标签/搜索