oracle中noguarantee,关于undo guarantee
undo_retention這個參數(shù)指定了undo表空間中的數(shù)據(jù)的最大保留時間,單位為秒,是動態(tài)參數(shù),也就是說我們可以在實例運行的時候?qū)@個參數(shù)進行修改,默認(rèn)值為900s(15min)。undo_retention只是指定了undo數(shù)據(jù)的過期時間,并不是說undo中的數(shù)據(jù)一定會在表空間中保留15min。當(dāng)undo表空間已被寫滿,新的事務(wù)就會自動覆蓋那些已經(jīng)提交的事務(wù)數(shù)據(jù),而不會去理會這些數(shù)據(jù)是否已經(jīng)過期。
undo_retention指定的時間一過,已提交的數(shù)據(jù)就立刻無法訪問,它只是失效,但是只要沒有被新數(shù)據(jù)覆蓋就仍然存在,并且可隨時被flashback特性引用。如果undo表空間足夠大,而數(shù)據(jù)庫又不是那么繁忙,那么undo_retention的值并不會有影響,只要沒有事務(wù)去覆蓋undo數(shù)據(jù),就會持續(xù)有效。
只有一種情況,undo表空間能夠確保undo數(shù)據(jù)在undo_retention指定的時間前一定有效,那就是為undo表空間指定retention guarantee,指定之后,對于undo表空間那些沒有過期的數(shù)據(jù)就不會被覆蓋。
可用如下命令查看當(dāng)前數(shù)據(jù)庫中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.
默認(rèn)為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.
總結(jié)
以上是生活随笔為你收集整理的oracle中noguarantee,关于undo guarantee的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php代码常见的变量缩写,PHP代码简洁
- 下一篇: Oracle导入到不同的角色,oracl