Oracle10g的UNDO_RETENTION自動化管理增強

oracle_ace發表於2009-11-20
在AUM模式下,我們知道UNDO_RETENTION引數用以控制事務提交以後undo資訊保留的時間。該引數以秒為單位,9iR1初始值為900秒,在Oracle9iR2增加為10800秒。但是這是一個NO Guaranteed的限制。

  
  也就是說,如果有其他事務需要回滾空間,而空間出現不足時,這些資訊仍然會被覆蓋。
  
  很多時候這是不希望看到的。
  
  從Oracle10g開始,如果你設定UNDO_RETENTION為0,那麼Oracle啟用自動調整以滿足最長執行查詢的需要。當然如果空間不足,那麼Oracle滿足最大允許的長時間查詢。而不再需要使用者手工調整。
  
  同時Oracle增加了Guarantee控制,也就是說,你可以指定UNDO表空間必須滿足UNDO_RETENTION的限制。
  
  SQL> alter tablespace undotbs1 retention guarantee;
  
  Tablespace altered
  
  SQL> alter tablespace undotbs1 retention noguarantee;
  
  Tablespace altered
  
  在DBA_TABLESPACES檢視中增加了RETENTION欄位用以描述該選項:
  
  SQL> select tablespace_name,contents,retention from dba_tablespaces;
  
  TABLESPACE_NAME        CONTENTS RETENTION
  ------------------------------ --------- -----------
  SYSTEM             PERMANENT NOT APPLY
  UNDOTBS1            UNDO   NOGUARANTEE
  SYSAUX             PERMANENT NOT APPLY
  TEMP              TEMPORARY NOT APPLY
  USERS             PERMANENT NOT APPLY
  EYGLE             PERMANENT NOT APPLY
  TEST              PERMANENT NOT APPLY
  ITPUB             PERMANENT NOT APPLY
  TRANS             PERMANENT NOT APPLY
  BIGTBS             PERMANENT NOT APPLY
  TEMP2             TEMPORARY NOT APPLY
  TEMP03             TEMPORARY NOT APPLY
  DFMBRC             PERMANENT NOT APPLY
  T2K              PERMANENT NOT APPLY
  
  14 rows selected
  
  在Oracle官方文件上這樣解釋:
  RETENTION Undo tablespace retention:
  GUARANTEE - Tablespace is an undo tablespace with RETENTION specified as GUARANTEE
  
  A RETENTION value of GUARANTEE indicates that unexpired undo in all undo segments in the undo tablespace should be retained even if it means that forward going operations that need to generate undo in those segments fail.
  
  NOGUARANTEE - Tablespace is an undo tablespace with RETENTION specified as NOGUARANTEE
  
  NOT APPLY - Tablespace is not an undo tablespace.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12361284/viewspace-620166/,如需轉載,請註明出處,否則將追究法律責任。

相關文章