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