天天看點

How to calculate the undo_retention time

UNDO_RETENTION 

The undo_retention is a initialization parameter of the undo tablespace. The initialization parameter of undo_retention used to control the maximum data retention time, the undo_retention default value is 900 seconds. The undo_retention is a parameter in the spfile.ora initialization parameters file that specifies the time period in seconds for which a system retains undo data for committed transactions. 

UNDO_RETENTION = 900

How to calculate the undo_retention time? 

As the following formula.

Formula: 

Optimal Undo Retention =Actual Undo Size / (DB_BLOCK_SIZE  — UNDO_BLOCK_REP_ESC)

How to determine the undo_block_rep_sec?

SELECT MAX(undoblks/((end_time-begin_time)*3600*24)) 
"UNDO_BLOCK_PER_SEC"
FROM v$undostat;