分区 大小问题 大侠 解释 一下

热烈的红颜 2009-07-13 12:25:08
我指定的intial 16k next 16k pctincrease 50
单是 结果 我查询 分区的大小
第一块:16K
第二块:16K
第三块:24K
第四块:为什么变成了 40K??
...全文
42 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuyi8903 2009-07-14
  • 打赏
  • 举报
回复
你之前 作过purge吗?

liuyi8903 2009-07-14
  • 打赏
  • 举报
回复
16K
16K

16*(150 percent of 2)=16K*1.5=24
Explanation
-----------

When allocating an extent Oracle first looks for a free extent of the same size
we need. If this is not found then we allocate an extent that is the next
multiple of (5 * db_block_size) over the specified extent size if the extent
size is not already a multiple of (5 * db_block_size).

Let's say you have a database with an 8K db_block_size and you create a table
and specify an initial extent value of 96K. When you look in DBA_TABLES you see
the actual initial extent size that you specified however if you look in
DBA_EXTENTS where segment_name = '<TABLE_NAME>' you see that the actual size
of the extent is 120K.

This is because 96K is not a multiple of 40 (which is 5 * db_block_size)
so Oracle rounded up to the next highest multiple of 40 from 96 which is 120.
liuyi8903 2009-07-14
  • 打赏
  • 举报
回复
Oracle rounded up to the next highest multiple of 40 from 96 which is 120.
热烈的红颜 2009-07-14
  • 打赏
  • 举报
回复
哦 好的 谢谢 上面 大哥

还有一个问题 我用的 solaris 10 X86 + Oracle 10g r2

结果 不能 使用 flashback table

我在 以非sysdba身份登录,使用的非system表空间建立的表
每次 使用drop 表后 show recyeclibin (user_recyclebin)是空的

是不是 版本有可能有问题啊 我在 windows 安装的 oracle 哪个版本就可以 或者 是哪里设置不正确
inthirties 2009-07-14
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 liujinfengliuyi 的回复:]
哦 好的 谢谢  上面 大哥

还有一个问题 我用的 solaris 10 X86 + Oracle 10g r2

结果 不能 使用 flashback table

我在 以非sysdba身份登录,使用的非system表空间建立的表
每次 使用drop 表后 show recyeclibin (user_recyclebin)是空的 

是不是 版本有可能有问题啊 我在 windows 安装的 oracle 哪个版本就可以  或者 是哪里设置不正确
[/Quote]

查查你的recycle的参数,如下
show parameter recycle

一般来说,recycle虽然是flashback里提到的,但是和flashback database是不同的实现方式,drop的表是放到recyclebin里的,而flashback database是用的flashback log来实现的,所以和flashback的开关无关,你查看recyclebin的开关就可以了。


而且,这里要注意,只有普通用户drop的表才能在recyclebin里,sys的drop表是不会在recyclebin的
inthirties 2009-07-13
  • 打赏
  • 举报
回复
intial 16k 分配给Segment的第一个extent的大小,第一个extent的大小也就是16k了。
第二个extent的大小等于next的初值,所以你这里next 16k,第二个extent的大小也就是16k了
而且,以后的next值是前一个next值大小乘以(1+pctincrease/100),你这里pctincrease 50,所以第三个extent的值是16+16×0.5=24k
根据上面的计算公式,如果你表内的数据扩张,需要extend新的区间的时候,第四个区间的大小应该是 24+24×0.5也就是36k,所以你这里得到40k,安装这个计算来说确实是很怪异的。

其实通过这里可以看到,pctincrease影响的是从第三区开始的区间,这样设置,在以后不停的扩张区间的时候,区间越分越大,从而避免了表的离散度越来越小,区间的内容越来越大,extent是连续的block,所以数据不至于过于分散,不过缺点也是很明显的,就是这里的增长是一个阶层增长,如果extent增长过多,最好势必导致一个extent超级大,需要系统分配很大的连续空间,以至于导致没有连续空间可分配的结果。所以,有的主张是0设置,当然这里是个经验参数,你可以根据自己的实际情况来设置,但是记住有这个问题存在。

对于10g来说,已经有好了存储,提出了assm的概念,所以你可以使用extent management local这样不通过数据字典而进行本地式自动管理。

热烈的红颜 2009-07-13
  • 打赏
  • 举报
回复
我建立表空间是通过 OMF
create tablespace t1
extent management dictionary
storage(
intial 16k
next 16k
pctincrease 50
minextents 1
maxextents unlimited
);

创建 表
create table student(id number)

然后插入了 50000挑数据

ldw2545398 2009-07-13
  • 打赏
  • 举报
回复
intial 16k 初始大小
next 16k 下一个大小
pctincrease 50 增加量% 这个是百分比
第二块你可以看成是增加 16*0%
第一次增加16*50% 第二次增加16*50+16*50%
liuyi8903 2009-07-13
  • 打赏
  • 举报
回复
建议你使用Locally Managed Tablespace
liuyi8903 2009-07-13
  • 打赏
  • 举报
回复
说得不清楚,把你的建表语句列出来,你是针对partition还是整个table?

erocyli 2009-07-13
  • 打赏
  • 举报
回复
sf不太理解,关注ing

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧