关于 数据文件自增长 的一点理解
?
?
同事問了我數(shù)據(jù)文件自增長的問題。
?
我對表空間數(shù)據(jù)文件的處理原則是:
(1)??? 數(shù)據(jù)文件設(shè)置為自增長,每次自增長的大小為100M。最大值32G。 因為8k的數(shù)據(jù)塊最大支持32G。
(2)??? 用腳本監(jiān)控表空間使用率,超過90%時,手動的添加數(shù)據(jù)文件。 因為現(xiàn)在的文件系統(tǒng)比以前的好,可以將單個數(shù)據(jù)文件設(shè)置成10G,20G。 都沒有什么問題。
?
?
?? 同事問我,為什么不使用自增長,這個問題我也給不出一個十分有說服力的解釋。 我把數(shù)據(jù)文件設(shè)成自增長是為了防止因為數(shù)據(jù)文件暴漲,導(dǎo)致表空間不足的問題。 至于手動添加數(shù)據(jù)文件,我的理解是多個數(shù)據(jù)文件比單個數(shù)據(jù)文件好,至少在出現(xiàn)壞塊的時候,可以減少數(shù)據(jù)丟失的可能性,而且如果把數(shù)據(jù)文件放在不同的位置,還可以提高I/O的性能。 和 DBA1群的 西安-布豆 討論了一下這個問題,他說Oracle 的專家也是使用手動添加數(shù)據(jù)文件的。
?
?????? 手動添加數(shù)據(jù)文件,增加了數(shù)據(jù)文件管理上的透明度,我們可以知道文件添加成功與否,而自動擴(kuò)展的話,可能會出現(xiàn)因磁盤空間不足而導(dǎo)致的擴(kuò)展失敗。
?
還有一點(diǎn)就是I/O的影響。 我的理解: 如果每次都自增100M,在磁盤分配的空間不一定是連續(xù)的。 這樣磁盤比較分散,每次讀數(shù)據(jù)的時候,I/O的時間比較長,如果一次給10G,這樣磁盤上空間是連續(xù)的,這樣I/O會塊一點(diǎn)。 在備份的時候,速度也會快一點(diǎn)。 西安-布豆 說這個是系統(tǒng)上應(yīng)該考慮的問題。
?
?????? 個人對這塊的理解也不是很透徹, 所以又google了一下。
?
?????? 這是itpub 論壇上,關(guān)于數(shù)據(jù)文件自增長的一些討論,也沒有一個統(tǒng)一的說法。
??? http://www.itpub.net/thread-1281633-1-1.html
?
?? 數(shù)據(jù)文件自增長的好處是很明顯的,不用DBA過多的關(guān)注表空間的問題。 但是我覺得監(jiān)控表空間是DBA日常職責(zé)之一,如果使用自增長的話,可能會在思想上出現(xiàn)麻痹,過度依賴數(shù)據(jù)文件的自增長。反而不利于數(shù)據(jù)庫的管理。
?
?
官網(wǎng)的一些說法:
?
You can create datafiles or alter existing datafiles so that they automatically increase in size when more space is needed in the database. The file size increases in specified increments up to a specified maximum.
Setting your datafiles to extend automatically provides these advantages:
·???????? Reduces the need for immediate intervention when a tablespace runs out of space
·???????? Ensures applications will not halt or be suspended because of failures to allocate extents
?
http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/dfiles003.htm
?
?
Autoextend Tablespace
You can set a tablespace to automatically extend itself by a specified amount when it reaches its size limit. If you do not enable autoextend, you are alerted when the tablespace reaches its critical or warning threshold size. The critical and warning threshold parameters have default values that you can change at any time. These parameters also cause alerts to be generated for autoextending tablespaces that are approaching their specified size limit. You can respond to size alerts by manually increasing the tablespace size. You do so by increasing the size of one or more of the tablespace datafiles or by adding another datafile to the tablespace.
http://download.oracle.com/docs/cd/B28359_01/server.111/b28301/storage001.htm#ADMQS12057
?
?
?
?
?
?
------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
網(wǎng)上資源: http://tianlesoftware.download.csdn.net
相關(guān)視頻:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1 群:62697716(滿); DBA2 群:62697977(滿)
DBA3 群:63306533;???? 聊天 群:40132017
--加群需要在備注說明SGA的組成部分,否則拒絕申請
轉(zhuǎn)載于:https://www.cnblogs.com/zlja/archive/2010/09/30/2449797.html
總結(jié)
以上是生活随笔為你收集整理的关于 数据文件自增长 的一点理解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SQL语句判断指定的数据库、表、字段、存
- 下一篇: AlertBox 弹出层(信息提示框)效