用户登录
用户注册

分享至

[转载]——Full UNDO Tablespace In 10gR2 and above (文档 ID 413732.1)

  • 作者: 执丶落
  • 来源: 51数据库
  • 2021-10-20

最近遇到了这个案例,官方文档已有详尽的分析、介绍,特转载在此,方便以后查看!

 

full undo tablespace in 10gr2 and above (文档 id 413732.1)

转到底部


in this document

 

symptoms

 

 

changes

 

 

cause

 

 

solution

 

 

references


applies to:

oracle database - enterprise edition - version 10.2.0.1 to 11.2.0.3 [release 10.2 to 11.2]
information in this document applies to any platform.
checked for relevance on 30-jun-2010
checked for relevance on 31-jan-2012


symptoms

in 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.

changes

starting with 10gr2, the max retention was introduced.

cause

here is a small test case for investigating this behavior:
before starting any transaction in the database:

sql> select count(status) from dba_undo_extents where status = 'unexpired';

count(status)
-------------
463

sql> select count(status) from dba_undo_extents where status = 'expired';

count(status)
-------------
20

sql> select count(status) from dba_undo_extents where status = 'active';

count(status)
-------------
21

space available reported by dba_free_space:

sum(bytes)/(1024*1024) tablespace_name
---------------------- ---------------------
      3                  undotbs1
      58.4375            sysaux
      3                  users3
      4.3125             system
      103.9375           users04

when the transactions run:

sum(bytes)/(1024*1024) tablespace_name
---------------------- ----------------
      58.25              sysaux
      98                 users3
      4.3125             system
      87.9375            users04

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.


10. try to steal unexpired extents from any online undo segment.
11. if all the above fails then return ora-30036 unable to extend segment by %s in undo tablespace '%s'

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.
this means that even if the undo_retention is set to a number of seconds (900 default), the fixed undo tablespace supports a bigger undo_retention time interval (e.g: 36 hours), based on the tablespace size, thing that makes the undo extents to be unexpired. but this doesn't indicate that there are no available undo extents when a transaction will be run in the database, as the unexpired undo segments will be reused.

 

solution

this 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

 

软件
前端设计
程序设计
Java相关