Undo有什么用?
自动undo 管理
用undo tablespace管理undo segment
用spfile初始参数设置undo tablespace, UNDO_TABLESPACE = undotbs_01, 注意如果你设置的undo tablespace不存在,startup会失败
Manual undo mangement的时候使用rollback segments管理undo
自动undo管理相关初始化参数
UNDO_MANAGEMENT=AUTO, or NULL表示auto management, MANUAL表示manual management
UNDO_TABLESPACE=tablespace_name01
Undo Retention Period
UNDO_RETENTION初始化参数设置minimum undo retention period
当transaction commit后, rollback和恢复就不需要undo data了.但是transaction开始之前就已经在运行的long-running query 还需要undo data来提供一致性读的特性.
undo retention period就设置了undo data可以被新的transactionoverwritten的最小时间.
undo retention period的值>time spend of long-running query
UNDO_RETENTION参数的2个例外
UNDO_RETENTION参数值太小,会出现2个错误
RETENTION GUARANTEE初始化参数
保证unexpired undo data不被overwritten
如何设置undo retention period
查看V$UNDOSTAT.TUNED_UNDORETENTION, 这个column存着4天内每10 分钟的数据
UNDO_RETENTION = 1800
ALTER SYSTEM SET UNDO_RETENTION = 2400;
用undo_advisor选择undo retention period时考虑2个条件
The length of your expected longest running query
The longest interval that you will require for Oracle Flashback operations
Undo 相关view
V$UNDOSTAT
V$ROLLSTAT
V$TRANSACTION
DBA_UNDO_EXTENTS
DBA_HIST_UNDOSTAT
原文地址:http://www.cnblogs.com/xzpp/p/3787611.html