Jcat
宠辱不惊,闲看庭前花开花落~~
posts - 173,comments - 67,trackbacks - 0
行链接:
1. 一条记录的大小大于block size,则产生行链接
2. 容易发生在比较大的行上
3. 因为行链接是由db_block_size不够大引起的,所以对已有的行链接是无法清除的
4. 9i以后,可以对不同的表空间设置不同的db_block_size,可以将一些特殊的宽表放在大block size的表空间

例子:
表空间block size为8k(8192),因为数据块头也要占一定空间,所以如下例,实际只能放7948的数据,一旦超过,就产生行链接

--无
create table test7948(a char(2000),b char(2000),c char(2000),d char(1948))
tablespace test;

insert into test7948 values('a','b','c','d');
commit;

--有
create table test7949(a char(2000),b char(2000),c char(2000),d char(1949))
tablespace test;

insert into test7949 values('a','b','c','d');
commit;



行迁移:
1. 本来是放的下的
2. 因为更新使row size变大了,一个block里又不足以放下增加的空间(PCTFREE相关),则产生行迁移
3. 容易发生在PCTFREE较小,对类似varchar类型的update又很多的表上
4. 无法避免,但通过把数据导出导入进行清除

例子:
--无
create table test7948_vchar(a char(2000),b char(2000),c char(2000),d char(1940), e varchar(9))
tablespace test;

insert into test7948_vchar values('a','b','c','d','12345678');
commit;

一更新,使得row size大于7948了,产生行迁移
--有
update test7948_vchar set e='123456789'
posted on 2010-06-13 14:08 Jcat 阅读(215) 评论(0)  编辑  收藏 所属分类: Database

只有注册用户登录后才能发表评论。


网站导航: