Thursday, February 12, 2009

Usage of UNDO tablespace constantly over 99% ?!

We had strange situation with one of our OLTP databases and I've spent some time to find explanation for it but still no answer that satisfies me.
When I find acceptable answer or Metalink document about this problem I'll post info here just for reminder.


Info:
OS: SunOS
DB: Oracle 9.2.0.6.0

undo_management=AUTO
undo_retention=14400
undo-size = 2GB

Usage of our UNDOTBS1 tablespace raised to 100% and I've decided to free some undo space because ORA-01555 errors started to show up.



To free some space I've tried to find transactions that were using undo blocks and commit or rollback those transactions.

But when I queried:
select t.used_ublk, t.*
from v$transaction t
order by t.used_ublk desc;

there were transactions with just few blocks used - UNDOTBS1 tablespace was 2 GB large.

So to avoid ORA-01555 errors I've created another undo tablespace UNDOTBS2 and made that tbs as default.

CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE
'/ora/oradata/undotbs02.dbf' SIZE 2048M REUSE AUTOEXTEND OFF;

alter system set undo_tablespace=UNDOTBS2 scope=both;



Then I could without pressure examine what happened.
I queried DBA_UNDO_EXTENTS and found out that there were lots of undo segments situated in UNDOTBS1 tablespace.

select segment_name, owner, tablespace_name, status
from dba_rollback_segs;

SEGMENT_NAME OWNER TABLESPACE_NAME STATUS

SYSTEM SYS SYSTEM ONLINE
_SYSSMU1$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU2$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU3$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU4$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU5$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU6$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU7$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU8$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU9$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU10$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU11$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU12$ PUBLIC UNDOTBS1 OFFLINE
_SYSSMU13$ PUBLIC UN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DOTBS2 ONLINE
_SYSSMU46$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU47$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU48$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU49$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU50$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU51$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU52$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU53$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU54$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU55$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU56$ PUBLIC UNDOTBS2 ONLINE
_SYSSMU57$ PUBLIC UNDOTBS2 ONLINE


Only offline rollback segments in UNDOTBS1 tablespace.

How come that this UNDOTBS1 tablespace was used 100% but when I tried to find transactions which were using that undo/rollback segments I couldn't find none.

I understand that there was transaction/transactions that eventually used whole UNDO tablespace, but they finished with their work - commit or rollback was executed.

This allocated UNDO space should be reused by another transactions - but insted of reusing UNDO space I got several:
ORA-01555 caused by SQL statement below (Query Duration=78 sec, SCN: 0x0004.f253ce76):


This was production database so I recreated UNDO tablespace as it was before. I've dropped UNDOTBS1 and created new one on the same location. Also made id as a default undo tablespace. After that dropped newly created UNDOTBS2.

I think that this was Oracle bug but still I am eager to find metalink document that confirms my thoughts.



Link on OTN forum: Click here!

0 Comments:

Post a Comment