Undo Retention

 

When automatic undo management is enabled, there is always a current undo retention period, which is the minimum amount of time that the Oracle Database attempts to retain old undo information before overwriting it. Old (committed) undo information that is older than the current undo retention period is said to be expired. Old undo information with an age that is less than the current undo retention period is said to be unexpired.

 

If you would like to Enrich your career with a Database Administrator(DBA) and get Oracle certified professional, then visit Mindmajix - A Global online training platform: “Oracle DBA Training”  Course.  This course will help you to achieve excellence in this domain.

Undo Retention in Oracle DBA

Oracle Database automatically tunes the undo retention period based on undo tablespace size and system activity. You can specify a minimum undo retention period (in seconds) by setting the undo_retention initialization parameter.

The database makes its best effort to honor the specified minimum undo retention period, provided that the undo tablespace has space available for new transactions.

 MindMajix YouTube Channel

When available space for new transactions becomes short, the database begins to overwrite expired undo. If the undo tablespace has no space for new transactions after all expired undo is overwritten, the database may begin overwriting unexpired undo information.

If any of this overwritten undo information is required for consistent read in a current long-running query, the query could fail with the snapshot too old error message.

[Related Article: Oracle Database Administrator Tutorial]

The following points explain the exact impact of the undo_retention parameter on undo retention:

  • The undo_retention parameter is ignored for a fixed size undo tablespace. The database may overwrite unexpired undo information when tablespace space becomes low.
  • For an undo tablespace with the auto-extend option enabled, the database attempts to honor the minimum retention period specified by undo_retention. When space is low, instead of overwriting unexpired undo information, the tablespace auto-extends. If the max size clause is specified for an auto-extending undo tablespace, when the maximum size is reached, the database may begin to overwrite unexpired undo information.

[Related Article: Managing the Redo Log]

Retention guarantee:

To guarantee the success of long-running queries or oracle flashback operations, you can enable retention guarantee. If retention guarantee is enabled, the specified minimum undo retention is guaranteed; the database never overwrites unexpired undo data even if it means that transactions fail due to lack of space in the undo tablespace.

If the retention guarantee is not enabled, the database can overwrite unexpired undo when space is low, thus lowering the undo retention for the system. This option is disabled by default.

[Related Article: Oracle DBA Interview Questions]

Note:

Enabling retention guarantee can cause multiple DML operations to fail.

You enable retention guarantee by specifying the retention guarantee clause for the undo tablespace when you create it with either the create a database or create an undo tablespace statement. Or, you can later specify this clause in an alter tablespace statement. You disable the retention guarantee with the retention no guarantee clause.

You can use the dba_tablespaces view to determine the retention guarantee setting for the undo tablespace. A column named retention contains a value of guarantee, no guarantee, or not apply (used for tablespaces other than the undo tablespace).

Explore Oracle DBA Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download Now!

 

Job Support Program

Online Work Support for your on-job roles.

jobservice

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreGet Job Support
Course Schedule
NameDates
Oracle DBA TrainingNov 19 to Dec 04View Details
Oracle DBA TrainingNov 23 to Dec 08View Details
Oracle DBA TrainingNov 26 to Dec 11View Details
Oracle DBA TrainingNov 30 to Dec 15View Details
Last updated: 04 Apr 2023
About Author

 

Technical Content Writer

read less