关于 数据文件自增长 的一点理解
?
?
同事問了我數(shù)據(jù)文件自增長(zhǎng)的問題。
?
我對(duì)表空間數(shù)據(jù)文件的處理原則是:
(1)??? 數(shù)據(jù)文件設(shè)置為自增長(zhǎng),每次自增長(zhǎng)的大小為100M。最大值32G。 因?yàn)?/span>8k的數(shù)據(jù)塊最大支持32G。
(2)??? 用腳本監(jiān)控表空間使用率,超過90%時(shí),手動(dòng)的添加數(shù)據(jù)文件。 因?yàn)楝F(xiàn)在的文件系統(tǒng)比以前的好,可以將單個(gè)數(shù)據(jù)文件設(shè)置成10G,20G。 都沒有什么問題。
?
?
?? 同事問我,為什么不使用自增長(zhǎng),這個(gè)問題我也給不出一個(gè)十分有說服力的解釋。 我把數(shù)據(jù)文件設(shè)成自增長(zhǎng)是為了防止因?yàn)閿?shù)據(jù)文件暴漲,導(dǎo)致表空間不足的問題。 至于手動(dòng)添加數(shù)據(jù)文件,我的理解是多個(gè)數(shù)據(jù)文件比單個(gè)數(shù)據(jù)文件好,至少在出現(xiàn)壞塊的時(shí)候,可以減少數(shù)據(jù)丟失的可能性,而且如果把數(shù)據(jù)文件放在不同的位置,還可以提高I/O的性能。 和 DBA1群的 西安-布豆 討論了一下這個(gè)問題,他說Oracle 的專家也是使用手動(dòng)添加數(shù)據(jù)文件的。
?
?????? 手動(dòng)添加數(shù)據(jù)文件,增加了數(shù)據(jù)文件管理上的透明度,我們可以知道文件添加成功與否,而自動(dòng)擴(kuò)展的話,可能會(huì)出現(xiàn)因磁盤空間不足而導(dǎo)致的擴(kuò)展失敗。
?
還有一點(diǎn)就是I/O的影響。 我的理解: 如果每次都自增100M,在磁盤分配的空間不一定是連續(xù)的。 這樣磁盤比較分散,每次讀數(shù)據(jù)的時(shí)候,I/O的時(shí)間比較長(zhǎng),如果一次給10G,這樣磁盤上空間是連續(xù)的,這樣I/O會(huì)塊一點(diǎn)。 在備份的時(shí)候,速度也會(huì)快一點(diǎn)。 西安-布豆 說這個(gè)是系統(tǒng)上應(yīng)該考慮的問題。
?
?????? 個(gè)人對(duì)這塊的理解也不是很透徹, 所以又google了一下。
?
?????? 這是itpub 論壇上,關(guān)于數(shù)據(jù)文件自增長(zhǎng)的一些討論,也沒有一個(gè)統(tǒng)一的說法。
??? http://www.itpub.net/thread-1281633-1-1.html
?
?? 數(shù)據(jù)文件自增長(zhǎng)的好處是很明顯的,不用DBA過多的關(guān)注表空間的問題。 但是我覺得監(jiān)控表空間是DBA日常職責(zé)之一,如果使用自增長(zhǎng)的話,可能會(huì)在思想上出現(xiàn)麻痹,過度依賴數(shù)據(jù)文件的自增長(zhǎng)。反而不利于數(shù)據(jù)庫(kù)的管理。
?
?
官網(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的組成部分,否則拒絕申請(qǐng)
轉(zhuǎn)載于:https://www.cnblogs.com/zlja/archive/2010/09/30/2449797.html
總結(jié)
以上是生活随笔為你收集整理的关于 数据文件自增长 的一点理解的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SQL语句判断指定的数据库、表、字段、存
- 下一篇: AlertBox 弹出层(信息提示框)效