Posted on 2009-08-13 15:12
Prayer 閱讀(936)
評論(0) 編輯 收藏 引用 所屬分類:
DB2 、
系統(tǒng)、備份等
每個DBA Team在建庫時,對數(shù)據(jù)文件采用文件系統(tǒng)還是裸設(shè)備都是分成兩派的,雙方都很難說服對方,我這里也分析一下數(shù)據(jù)文件用文件系統(tǒng)還是裸設(shè)備的各自優(yōu)劣。
速度
都說裸設(shè)備比文件系統(tǒng)快,因為少走了OS的cache。但到底快多少呢?IBM還說自己的jfs2比裸設(shè)備快呢!
我們用ORION(oracle提供的存儲測試工具,可以從otn網(wǎng)站下載,模擬數(shù)據(jù)庫對存儲的讀寫操作)測試了一下:
存儲SUN2540 兩個盤
文件系統(tǒng)讀:
Maximum Large MBPS=205.34 @ Small=0 and Large=4
Maximum Small IOPS=1160 @ Small=10 and Large=0
Minimum Small Latency=4.51 @ Small=1 and Large=0
祼設(shè)備讀:
Maximum Large MBPS=205.02 @ Small=0 and Large=4
Maximum Small IOPS=1161 @ Small=10 and Large=0
Minimum Small Latency=4.49 @ Small=1 and Large=0
文件系統(tǒng)寫
Maximum Large MBPS=84.48 @ Small=0 and Large=4
Maximum Small IOPS=675 @ Small=1 and Large=0
Minimum Small Latency=1.48 @ Small=1 and Large=0
裸設(shè)備寫
Maximum Large MBPS=83.92 @ Small=1 and Large=4
Maximum Small IOPS=674 @ Small=1 and Large=0
Minimum Small Latency=1.48 @ Small=1 and Large=0
從以上數(shù)據(jù)可以看出,速度基本差不多,如果因為速度要使用祼設(shè)備的理由就不成立了。
防誤刪除:
文件被誤刪除后基本不能恢復(fù),數(shù)據(jù)丟失。
祼設(shè)備被誤刪除后,可以重新建立,數(shù)據(jù)不丟失。
擴(kuò)展性:
數(shù)據(jù)件在文件系統(tǒng)中可以自動擴(kuò)展
祼設(shè)備不能自動擴(kuò)展,如果容量不夠需要增加祼設(shè)備作為新的數(shù)據(jù)文件來擴(kuò)充表空間。
需要注意的一個問題是,自動擴(kuò)展是不是一定好?!
很多DBA喜歡把datafile設(shè)置成autoextend on maxsize unlimited,我覺得比較嚴(yán)謹(jǐn)?shù)淖鞣ㄟ€是要設(shè)置一個合理的maxsize。
防止應(yīng)用的錯誤向表空間中插入垃圾記錄,在文件系統(tǒng)中可能會把整個文件系統(tǒng)的free space消耗光!
移植性
文件可能通過copy的方式很方便的實現(xiàn)遷移,裸設(shè)備很困難。
Dataguard時祼設(shè)備不能自動創(chuàng)建數(shù)據(jù)文件
也就是這個參數(shù)standby_file_management 設(shè)置成auto沒有用。
寫到這兒就行了,到底用文件系統(tǒng)還是裸設(shè)備大家自己定吧。