系統管理
1754014 會員
3778 線上
108811 解決方案
發表新文章

與 block 大小有關的問題

 
watermelonyu
教授

與 block 大小有關的問題

1. 假設 filesystem block size 是 8K,有一個檔案大小是 2K。如果某個 block 放了這個檔案後,還能再存放其他檔案嗎?還是一個 block 只能放一個檔案。



2. 在 Oracle 的 database 中有定義 database block 的大小。假設 DB block size 為 4K,該 DB 所位於的 filesystem block size 是 8K。如果有一個 datafile 大小是 40K,那這個 datafile 所佔的實際 filesystem block 數目是 5 個,還是 10 個?(也就是說,這個 datafile 所屬的 10 個 DB block 會被分配到幾個 filesystem block 裡面?)



3. Filesystem block 大小的選擇就空間使用率與效能上來考量會有怎樣的影響?



3則回覆 3
watermelonyu
教授

與 block 大小有關的問題

回答第一个问题:

我觉得应该是可以放的!真到把这个块放满。

当然了,有些情况就是说如果刚好你的东西到最后,就只剩下2K,你如果放下来的话,系统会认成你的文件大小为8K,感觉这和建立lvol的时候性质应该是一样,所以提出了我的意见,希望可以探讨!
watermelonyu
教授

與 block 大小有關的問題

Anwser 1:

The original unix file system allowed the blocks

of a single file to be spread across the entire

disk space with no attempt to keep related blocks

in any type of order. This played well when the

kernel was trying to figure out where to put the

next block of data.



Answer 3:

As disks got bigger, the tendency was to increase

the file system block size to keep the management

overhead to an acceptable limit. This was fine as

long as you didn't have lots of very small files.

A file with only a small number of bytes would

require an entire block for its storage. This

could result in an inefficient utilization of

disk space.



Besides, you also have to consider the fragment

issue, if possible attend to H4262S training, that

will help you understand more.

watermelonyu
教授

與 block 大小有關的問題

Ans 2 : 5

For good performance Oracle Block size should be made equal to or a multiple of the O/S blocksize. It is not sensible to have the size SMALLER than the OS blocksize as a single read will actually read in 'OS block size bytes' even if only part of this is passed on to Oracle.