最近遇到了这个案例,官方文档已有详尽的分析、介绍,特转载在此,方便以后查看!
full undo tablespace in 10gr2 and above (文档 id 413732.1) |
转到底部 |
|
in this document
applies to:oracle database – enterprise edition – version 10.2.0.1 to 11.2.0.3 [release 10.2 to 11.2]
symptomsin a 10gr2 database with an undo tablespace created in no autoextend mode, having transactions running in the database, apparently the undo tablespace appears to be full. also many unexpired undo segments can be seen when selecting from dba_undo_extents view, although no ora-1555 or ora-30036 errors are reported. changesstarting with 10gr2, the max retention was introduced. causehere is a small test case for investigating this behavior: sql> select count(status) from dba_undo_extents where status = ‘unexpired’; count(status) sql> select count(status) from dba_undo_extents where status = ‘expired’; count(status) sql> select count(status) from dba_undo_extents where status = ‘active’; count(status) space available reported by dba_free_space: sum(bytes)/(1024*1024) tablespace_name when the transactions run: sum(bytes)/(1024*1024) tablespace_name the undo block allocation algorithm in automatic undo management is the following : 1. if the current extent has more free blocks then the next free block is allocated.
2. otherwise, if the next extent expired then wrap in the next extent and return the first block. 3. if the next extent is not expired then get space from the undo tablespace. if a free extent is available then allocate it to the undo segment and return the first block in the new extent. 4. if there is no free extent available, then steal expired extents from offline undo segments. de-allocate the expired extent from the offline undo segment and add it to the undo segment. return the first free block of the extent. 5. if no expired extents are available in offline undo segments, then steal from online undo segments and add the new extents to the current undo segment. return the first free block of the extent. 6. extend the file in the undo tablespace. if the file can be extended then add an extent to the current undo segment and then return the block. 7. tune down retention in decrements of 10% and steal extents that were unexpired, but now expired with respect to the lower retention value. 8. steal unexpired extents from any offline undo segments. 9. try to reuse unexpired extents from own undo segment. if all extents are currently busy (they contains uncommitted information) go to the step 10. otherwise, wrap into the next extent.
when the undo tablespace is created with no autoextend, following the allocation algorithm, here is the explanation for this correct behavior: for a fixed size undo tablespace (no autoextend), starting with 10.2, we provide max retention given the fixed undo space, which is set to a value based on the undo tablespace size.
solutionthis is a correct behavior, concerning an undo tablespace created with autoextend off in 10gr2, so there is not need to add more space to it or be concerned by the fact that it appears to be 100% full. note: if you do experience ora-1555 or ora-30036 errors and see these same symptoms, please refer to note 420525.1 |