oracle中noguarantee,关于undo guarantee
undo_retention這個參數指定了undo表空間中的數據的最大保留時間,單位為秒,是動態參數,也就是說我們可以在實例運行的時候對這個參數進行修改,默認值為900s(15min)。undo_retention只是指定了undo數據的過期時間,并不是說undo中的數據一定會在表空間中保留15min。當undo表空間已被寫滿,新的事務就會自動覆蓋那些已經提交的事務數據,而不會去理會這些數據是否已經過期。
undo_retention指定的時間一過,已提交的數據就立刻無法訪問,它只是失效,但是只要沒有被新數據覆蓋就仍然存在,并且可隨時被flashback特性引用。如果undo表空間足夠大,而數據庫又不是那么繁忙,那么undo_retention的值并不會有影響,只要沒有事務去覆蓋undo數據,就會持續有效。
只有一種情況,undo表空間能夠確保undo數據在undo_retention指定的時間前一定有效,那就是為undo表空間指定retention guarantee,指定之后,對于undo表空間那些沒有過期的數據就不會被覆蓋。
可用如下命令查看當前數據庫中undo的retention guarantee:
SYS@orcl 07-SEP-14>select tablespace_name,contents,retention
2 ?from dba_tablespaces;
TABLESPACE_NAME ? ? ?CONTENTS ?RETENTION
-------------------- --------- -----------
SYSTEM ? ? ? ? ? ? ? PERMANENT NOT APPLY
SYSAUX ? ? ? ? ? ? ? PERMANENT NOT APPLY
TEMP ? ? ? ? ? ? ? ? TEMPORARY NOT APPLY
USERS ? ? ? ? ? ? ? ?PERMANENT NOT APPLY
UNDOTBS2 ? ? ? ? ? ? UNDO ? ? ?NOGUARANTEE
EXAMPLE ? ? ? ? ? ? ?PERMANENT NOT APPLY
TEST ? ? ? ? ? ? ? ? PERMANENT NOT APPLY
HH ? ? ? ? ? ? ? ? ? PERMANENT NOT APPLY
GOODS ? ? ? ? ? ? ? ?PERMANENT NOT APPLY
DATA01 ? ? ? ? ? ? ? PERMANENT NOT APPLY
10 rows selected.
默認為NOGUARANTEE
用如下命令修改undotbs2的retention guarantee:
SYS@orcl 07-SEP-14>alter tablespace undotbs2 retention guarantee;
Tablespace altered.
SYS@orcl 07-SEP-14>select tablespace_name,contents,retention
2 ?from dba_tablespaces;
TABLESPACE_NAME ? ? ?CONTENTS ?RETENTION
-------------------- --------- -----------
SYSTEM ? ? ? ? ? ? ? PERMANENT NOT APPLY
SYSAUX ? ? ? ? ? ? ? PERMANENT NOT APPLY
TEMP ? ? ? ? ? ? ? ? TEMPORARY NOT APPLY
USERS ? ? ? ? ? ? ? ?PERMANENT NOT APPLY
UNDOTBS2 ? ? ? ? ? ? UNDO ? ? ?GUARANTEE
EXAMPLE ? ? ? ? ? ? ?PERMANENT NOT APPLY
TEST ? ? ? ? ? ? ? ? PERMANENT NOT APPLY
HH ? ? ? ? ? ? ? ? ? PERMANENT NOT APPLY
GOODS ? ? ? ? ? ? ? ?PERMANENT NOT APPLY
DATA01 ? ? ? ? ? ? ? PERMANENT NOT APPLY
10 rows selected.
使用如下命令禁止使用retention guarantee:
SYS@orcl 07-SEP-14>alter tablespace undotbs2 retention noguarantee;
Tablespace altered.
總結
以上是生活随笔為你收集整理的oracle中noguarantee,关于undo guarantee的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php代码常见的变量缩写,PHP代码简洁
- 下一篇: 建行分期通怎么还款