必须建立簇所以,才能往簇里面添加数据
create index stu_ach_index on cluster stu_ach
tablespace mybigspace;
insert into student4 values(1,'yangxiaoqi',24);
commit;
--修改
alter cluster stu_ach 
pctfree 60
pctused 50; 问下,pctfree与pctused参数是做什么用的?我baidu的时候,没有找到具体的解释!

解决方案 »

  1.   

    pctfree 60 数据库对象每一个数据块保留的可用空间的百分比。现在你设定为60%,表示对该对象存在和行更新或新的行插入时,每个块的保留空间为60%pctused 50;数据库对象每一个数据库的可用空间的百分比。PCTFREE integerSpecify a whole number representing the percentage of space in each data block of the database object reserved for future updates to rows of the object. The value of PCTFREE must be a value from 0 to 99. A value of 0 means that the entire block can be filled by inserts of new rows. The default value is 10. This value reserves 10% of each block for updates to existing rows and allows inserts of new rows to fill a maximum of 90% of each block.PCTFREE has the same function in the statements that create and alter tables, partitions, clusters, indexes, materialized views, and materialized view logs. The combination of PCTFREE and PCTUSED determines whether new rows will be inserted into existing data blocks or into new blocks.Restriction on the PCTFREE Clause When altering an index, you can specify this parameter only in the modify_index_default_attrs clause and the split_partition_clause.PCTUSED integerSpecify a whole number representing the minimum percentage of used space that Oracle maintains for each data block of the database object. A block becomes a candidate for row insertion when its used space falls below PCTUSED. PCTUSED is specified as a positive integer from 0 to 99 and defaults to 40.PCTUSED has the same function in the statements that create and alter tables, partitions, clusters, materialized views, and materialized view logs.PCTUSED is not a valid table storage characteristic for an index-organized table.The sum of PCTFREE and PCTUSED must be equal to or less than 100. You can use PCTFREE and PCTUSED together to utilize space within a database object more efficiently.Restrictions on the PCTUSED Clause You cannot specify this parameter for an index or for the index segment of an index-organized table.  
      

  2.   

    pctused, 10g出来后就不用了,9i还有这东西。
    pctfree, 就是插入数据时一个块预留多少空闲空间,以百分比为单位。
    比如,一个8K的块,一行数据是1K,那么这个块就可以放入8行数据。由于这些数据可能会被更新(比如某条记录的长度更新后为1.5K),记录的长度就会增加,如果8K的块放入8条记录的话,那么在更新时就会发生行迁移.我可以控制,这个8K的块只放入7行(即7K),留下1K做为更新之用。 pctfree就是这个参数,比如pctfree为10,表示一个块预留下10%的空间。
      

  3.   

    你到这里看看
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/clauses007.htm#g1058547
      

  4.   

    这两个是数据块管理参数,用于控制数据块中空闲空间的使用方法。PCTFREE用于指定数据块中必须保留的最小空闲空间比例,当数据块道道这个参数的限制后,该数据块将被标记为不可用,默认值为10。PCTUSED设置数据块是否可用的界限,也就是说,为了使数据块能够被再次使用,已经占用的存储空间必须低于PCTUSED设置的比例。在实际的应用中使用UPDATE操作较多,并且更新操作会增加记录的大小时,PCTFREE设置大些,这样记录变大时,记录仍然能够保存在原数据块中;PCTUSED设置小些,这样能够减少由于数据块在可用与不可用之间反复切换而造成的系统开销。推荐PCTFREE为20,PCTUSED为40。使用insert和delete操作较多,并且update操作不会增加记录的大小时,PCTFREE设置小些,PCTUSED设置大些,以便尽快重新利用被delete操作释放的存储空间。推荐PCTFREE位5,PCTUSED为60。