etl2007 发表于 2014-8-14 19:49:15

ASSM管理下,insert数据时是如何选择空闲块的

本帖最后由 etl2007 于 2014-8-14 23:34 编辑

因为在ASSM管理下

oracle 是通过位图方式来标示数据块的使用情况

参照
http://www.orafaq.com/wiki/ASSM

Free space tracking

Instead of trying to track the exact space inside a block (with a freelist), Oracle marks the block as one of six types, tracked by a bitmap. The 6 different "freeness statuses" are:
0 = unformatted
1 = logically full
2 = 0-25% free
3 = 25-50% free
4 = 50%-75% free
5 = 75-100% free


但我的问题 例如我现在
当我设置成PCTFREE=20%的时候,那么

3 = 25-50% free
4 = 50%-75% free
5 = 75-100% free

只有这三类才能被视为是可插入的。我之前表述不严谨,我指的可用是对插入可用

现在我需要插入一条数据,发现这 3种状态的数据块都能被插入
3 = 25-50% free
4 = 50%-75% free
5 = 75-100% free

我的问题是,oracle是选择哪一种 那一种数据块来插入呢?
麻烦指导一下

Maclean Liu(刘相兵 发表于 2014-8-14 20:01:25

这三类都是可用的,  什么叫可用?

这三个是状态,不明白为什么说可用?

etl2007 发表于 2014-8-14 22:27:43

Maclean Liu(刘相兵 发表于 2014-8-14 20:01 static/image/common/back.gif
这三类都是可用的,  什么叫可用?

这三个是状态,不明白为什么说可用? ...

我理解的可用,当我设置成PCTFREE=20%的时候,那么

3 = 25-50% free
4 = 50%-75% free
5 = 75-100% free

只有这三类才能被视为是可插入的。我之前表述不严谨,我指的可用是对插入可用

现在我需要插入一条数据,发现这 3种状态的数据块都能被插入
3 = 25-50% free
4 = 50%-75% free
5 = 75-100% free

我的问题是,具体选择哪一种,oracle是如何考虑的呢?是随机吗?

Maclean Liu(刘相兵 发表于 2014-8-14 23:21:18

你的1楼的描述和3楼的描述 简直是2个问题了, 请理清描述再提问

etl2007 发表于 2014-8-14 23:35:11

Maclean Liu(刘相兵 发表于 2014-8-14 23:21 static/image/common/back.gif
你的1楼的描述和3楼的描述 简直是2个问题了, 请理清描述再提问

刘大大,你好
我的问题就是3楼的问题
我将问题本身也修改了,即一楼也修改了,麻烦指导一下
谢谢

Maclean Liu(刘相兵 发表于 2014-8-15 13:39:47

ODM FINDING:

Searching for Space in L1 BMB
In each L1 BMB, find the most free DBA: the L1 BMB can be treated like a 2-
dimensional grid of DBAs: 16 X n (one dimension of the grid is fixed at 16). Hashing on
the process ID provides a random block as a starting point into the L1 BMB. Starting at
this point, the Oracle server commences to build an array of five candidate blocks. Moving
down the grid in a column-first fashion the Oracle server looks at every nth block
(wrapping around the block and continuing looking at other columns). When a candidate
DBA is seen, the Oracle server attempts to get the block in a nowait mode. If there is a
process active on the block, we move on to the next candidate block. The Oracle server
only does nowait gets on DBAs five (5) times before giving up this behavior and
releasing the L1 BMB, then just waiting to get a data block pinned in exclusive mode.
This model significantly reduces buffer busy waits events in the buffer cache. If an
unformatted DBA is found, the Oracle server releases the L1 BMB, regets it in exclusive
mode, formats a range of data blocks (16), moves HWMs as appropriate and then releases
the L1 BMB. A check is performed to see if the block pinned is useful (may not be usable
due to free-space credits being exposed in the L1 BMB). If it is useful, then the space
search is complete.
Note: The second dimension of the grid is a factor of the segment size.

Maclean Liu(刘相兵 发表于 2014-8-15 13:40:58



主要依据 是Hash on process ID to provide
starting point DBA,  对pid的hash值, 所以你可以认为 这是随机的
页: [1]
查看完整版本: ASSM管理下,insert数据时是如何选择空闲块的