eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 使用SET TRANSACTION给事务命名 | Blog首页 | 在Linux下使用Mutt发送邮件附件 »

Oracle10g的UNDO_RETENTION自动化管理增强

在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.


历史上的今天...
    >> 2011-03-15文章:
    >> 2009-03-15文章:
    >> 2006-03-15文章:
           梁启超之死
           我的写作进度

无觅

By eygle on 2005-03-15 09:56 | Comments (0) | Internal | 204 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com