?
Solved

Undo tablespace management

Posted on 2013-01-29
14
Medium Priority
?
479 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

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 1500 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to recover a database from a user managed backup
Suggested Courses

770 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