Solved

Undo tablespace management

Posted on 2013-01-29
14
470 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
  • 7
  • 6
14 Comments
 
LVL 76

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 34

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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 76

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 76

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 76

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 76

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 76

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 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
select only modified column name  based on the status 15 55
PAYER_ID has both atributes 4 37
selective queries 7 27
having some issue on pl sql procedure 1 19
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

776 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