[b]1.temporay table语法[/b]
a>:基于事务的临时的表空间
b>:基于session的临时表空间
[color=red]Hints:创建一个临时表,是属于所有的用户,还是只属于当前创建的用户呢?明天试下....[/color]
b>:pctused
[b]3.row Migration/row chaining[/b]
a>:row migration 如果该表的pctfree设置的比较小,当这个数据进行更新的时候,发现这个数据块已经没有足够的空间来存放当前的行,此时数据库必须寻找新的块来存放改行,并且把这行数据迁移到新的数据块.在先前的数据块中只保存一个指向新数据块的指针.从而导致数据库的性能下降.至少带来的double I/O
b>:row chaining 如果当一行的记录超过了256列或者是一行的记录特别大,数据库的一个数据块存储不小当前的数据,此时oracle会将行分成多个row pieces.这个时候当前行就会存储多个块的指针引用.此时就叫row chaining.一个都是因为数据块的大小过于小造成的.
[b]4.表的重组织[/b]
a>:基于事务的临时的表空间
create global temporary table tableName on commit delete rows (id number,name varchar2(10))
b>:基于session的临时表空间
create global temporary table tableName on commit preserve rows (id number,name varchar2(10))
[color=red]Hints:创建一个临时表,是属于所有的用户,还是只属于当前创建的用户呢?明天试下....[/color]
2.compute pctfree/pctused[只对手动管理方式有影响]
a>:pctfree
(Average row size - Initial row size)*100/Average row size[通过表分析可以得到]
b>:pctused
100-pctfree-Average row size*100/Available data space
[b]3.row Migration/row chaining[/b]
a>:row migration 如果该表的pctfree设置的比较小,当这个数据进行更新的时候,发现这个数据块已经没有足够的空间来存放当前的行,此时数据库必须寻找新的块来存放改行,并且把这行数据迁移到新的数据块.在先前的数据块中只保存一个指向新数据块的指针.从而导致数据库的性能下降.至少带来的double I/O
b>:row chaining 如果当一行的记录超过了256列或者是一行的记录特别大,数据库的一个数据块存储不小当前的数据,此时oracle会将行分成多个row pieces.这个时候当前行就会存储多个块的指针引用.此时就叫row chaining.一个都是因为数据块的大小过于小造成的.
[b]4.表的重组织[/b]
--------命令
alter table tablename move tablespace newtabs
--------查看表的详细结构(9i有bug)
select dbms_metadata.get_ddl('对象的类型','对象的名字')
----删除表,cascade constrains 删除以张表作为主表的从表
drop table tablename cascade constraints
-------使用unused选项
alter table tablename set unused colname;
alter table tablename drop unused colname checkpoint 1000;
alter table tablename drop columns continue checkpoint 1000;
alter table tablename allocate extent;