Undo tablespace management

Hello All,
I got a scnearao I have accidentally added multiple datafiles to the undo table space and due to that the  oradata directory  got filled up to 90% and we are getting the alerts. Its a oracle 9i PRODUCTIONdatabase and a regular filesystem. i TRIED TO RESIZE THE DATAFILES but getting  ERROR at line 1:
ORA-03297: file contains used data beyond requested RESIZE value..

let me know how can i avoid this situation
bhanu823Asked:
Who is Participating?
 
slightwv (䄆 Netminder)Connect With a Mentor Commented:
>>how do i know  when will the  the active transaction  finishes?

Easiest way, you were able to drop the original undo tablespace.

you can query for them using v$transaction:
V$TRANSACTION lists the active transactions in the system.

http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3114.htm#REFRN30291


Here is a pre-built script (I didn't test it but it looks OK):
http://gavinsoorma.com/2009/06/identify-active-transactions-in-undo-and-rollback-segments/


>>and if i have t create a new undo tablespace I have to create with the same number of datafiles as the old one?

No.  It is a brand new tablespace.  Create it with whatever datafiles you wish.  Of course, they will have to be new datafile names.
0
 
slightwv (䄆 Netminder) Commented:
Create a new undo tablespace, make it the system undo tablespace, then drop the original one.

http://dbaforums.org/oracle/index.php?showtopic=18946
0
 
bhanu823Author Commented:
if i create a new one and drop the old one .what happenes to the data in the datafiles of the old undo..and also how can i drop the old one if it has active transactions and if it uses the datafiles in the old UNDO?
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
johnsoneSenior Oracle DBACommented:
You will not be able to drop the old one until the transactions complete.  If you try to drop it and there are active transactions, then you will get an error.  You may need to wait until all sessions exit and reconnect as well, I don't remember exactly when it grabs the undo tablespace, it could be session level and not transaction level.  But, either way, the database will not let you drop it if it is still needed.

The data in that tablespace is transient.  For recovery purposes, you shouldn't need it.
0
 
bhanu823Author Commented:
what if i take an outage from the application team and drop some of the datafiles in the undo tablespace?.. willi loose transactions or any data in the datafiles i have?..(assuming i got an outage time and fron end apps are down)
0
 
slightwv (䄆 Netminder) Commented:
I don't believe you can drop datafiles in UNDO.

As mentioned above, you cannot drop UNDO if there are active transactions.

Create the new UNDO tablespace, set it to the system 'default' and wait.  Eventuall and active transactions in the original should finish and you will be able to drop it.

If you cannot wait, create the new undo and bounce the database.
0
 
bhanu823Author Commented:
question to   slightwv

you said "active transactions in the original should finish and you will be able to drop it.

If I cannot wait create the new undo and bounce the database. "..

how do i know  when will the  the active transaction  finishes?

and if i have t create a new undo tablespace I have to create with the same number of datafiles as the old one?
0
 
bhanu823Author Commented:
hi..
why do i need to bounce the database?
0
 
slightwv (䄆 Netminder) Commented:
>>why do i need to bounce the database?

You don't.  You only need to if you cannot wait for all existing transactions to commit or rollback that are locking your existing UNDO tablespace.

Bouncing the database will kill all current transactions(given the proper shutdown directive), thus freeing up your old UNDO tablespace allowing you to drop it.
0
 
bhanu823Author Commented:
I read somewhere that undo does not hold any data. is it true?
0
 
slightwv (䄆 Netminder) Commented:
It depends on how you define 'data'.

It does not hold 'permanant' data.  You cannot create a table in that tablespace and insert rows into it.

If you call transactional data, as data, then yes it does contain data.

If I issue the following statement and do not commit it or rollback, is there 'data' in UNDO?
insert into tableA values('a');

The answer depends on your definition.
0
 
slightwv (䄆 Netminder) Commented:
Mind if I ask what additional information you needed before giving me an "A" grade?

Since you never posted back, I had to assume the queston was answered.
0
 
bhanu823Author Commented:
hi..i am satisfied with the asnswers you have provided.thats why i chose A.   I was not able to test it as it was a production database and somebody in my team took care of that issue. All he did is took an outage and move the  undo tbs datafiles to other mount points. he ddi not shriink or remove any datafile
0
 
slightwv (䄆 Netminder) Commented:
This was closed with a "B" grade not an "A".  This is why I asked.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.