http://dbatips4u.blogspot.ru/2008/04/tip12-status-column-of-dbaundoextents.html
SELECT tablespace_name, status, COUNT (*)
FROM SYS.dba_undo_extents
WHERE tablespace_name = 'UNDOTBS2'
GROUP BY tablespace_name, status
What is of our interest is status column of dba_undo_extents, 3 possible values - ACTIVE, EXPIRED, UNEXPIRED. What are the meanings ?
ACTIVE means that this undo segment contains active transactions
EXPIRED means that this segment is not rqeuired at all after considering Undo retention period
UNEXPIRED means that this segment does not contain any active transactions but it contains transactions which are still required for Flashback option (after considering Undo retention period).
So if you have all extents EXPIRED then go ahead and drop the tablespace, as usual make sure that you have done proper backup before and after.
How much undo space do we need:
select
round(max(undoblks/600)*8192*max(maxquerylen)/(1024*1024)) as "UNDO in MB"
from v$undostat;
What max undo retention time do we need?
select max(maxquerylen) from v$undostat;
|