Solved

Undo tablespace management

Posted on 2013-01-29
14
478 Views
Last Modified: 2013-02-07
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
0
Comment
Question by:bhanu823
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38831247
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
 

Author Comment

by:bhanu823
ID: 38831271
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
 
LVL 35

Expert Comment

by:johnsone
ID: 38831281
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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:bhanu823
ID: 38831306
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
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38831318
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
 

Author Comment

by:bhanu823
ID: 38831337
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
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 38831377
>>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
 

Author Comment

by:bhanu823
ID: 38831788
hi..
why do i need to bounce the database?
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38831811
>>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
 

Author Comment

by:bhanu823
ID: 38832108
I read somewhere that undo does not hold any data. is it true?
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38832473
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
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38865185
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
 

Author Comment

by:bhanu823
ID: 38865253
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
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38865269
This was closed with a "B" grade not an "A".  This is why I asked.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question