Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Flush UNDOTBS?

Re: Flush UNDOTBS?

From: Norman Dunbar <>
Date: Tue, 07 Feb 2006 07:56:38 +0000
Message-Id: <>

Morning J Dex,

Norman Dunbar.
Contract Oracle DBA.
Rivers House, Leeds.

Internal : 7 28 2051
External : 0113 231 2051

>>> "J. Dex" <> 02/07/06 03:10am >>>
>> How can the UNDOTBS be flushed so that it isn't used?

You simply don't need to flush the UNDO tablespace. It's a wee bit like the old 'how do I flush TEMP' queries of old.

There are undo extents created in the UNDO tablespace. Once used, they get retained for a while as set by UNDO_RETENTION, the time is in seconds, then they expire.

Until an extent is flagged as expired, it will not be overwritten as long as there are other expired extents to be reused, or free space to create new extents.

Extents currently in use will show up as active.

Try this :

SELECT tablespace_name, status, COUNT(*) AS HOW_MANY FROM dba_undo_extents
GROUP BY tablespace_name, status;

You might get something like the following :

------------------------------ --------- ----------
UNDO                           EXPIRED           87
UNDO                           UNEXPIRED        187
UNDO                           ACTIVE             7

So as long as there are some EXPIRED and/or UNEXPIRED you will not run out of UNDO - unless you run the 'update from hell and fill' the entire tablespace.

From the above, I've got 281 undo extents already, 7 are currently being used for something, 187 are being retained - just in case - and 87 have expired and can be reused if more active extents are needed.

Oracle will reuse unexpired extents if it has to, so the UNDO_RETENTION setting is only advisory.

HTH Cheers,

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.

We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at

Received on Tue Feb 07 2006 - 01:56:38 CST

Original text of this message