Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

Free Oracle Tips

HTML Text

 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB   


 

 

 


 

 

 

 
 

Oracle Concepts - Oracle undo tips

Oracle Tips by Burleson Consulting

Administering Oracle UNDO

Oracle allows you to make changes to the database in kind of a “try it before you buy it mode”. What this means is that the changes you make in the database can only be seen by you, at first. Hence, you can make changes, check those changes and make sure they are ok, before you let anyone else see them. Once you are sure you like your changes, you issue the commit command, and everyone else can then see them.

This type of functionality gives us database consistency. This means that the data in the database, when you query it, is always consistent to the same point in time. For example, if you query two tables at the same time, say tables named PARENT and CHILD, you will see record from both tables as they looked at the same point in time. This means that no one can slip a record into the CHILD table, while you are reading the PARENT table, or vice versa. The assurance that the records you will read will be consistent to the same point in time, is known as read consistency.  Read consistency gives your query’s results as they were the moment you pressed Enter.

Oracle Undo segments support these read consistent operations (and other database operations such as flashback operations which we will discuss later in this book). Oracle creates an undo segment in the SYSTEM tablespace when the database is created. This undo segment only supports operations in the SYSTEM tablespace. Hence, if you are going to use other tablespaces (and you should!), then you will need other undo segments.

select  
   substr(a.os_user_name,1,15)   "OS User",
   substr(a.oracle_username,1,8) "DB User",
   substr(b.owner,1,8)           "Schema",
   substr(b.object_name,1,20)    "Object Name",
   substr(b.object_type,1,10)    "Type",
   substr(c.segment_name,1,15)   "RBS",
   substr(d.used_urec,1,12)      "# of Records",
   e.sid,
   e.serial#
from v$locked_object    a,
     dba_objects        b,
     dba_rollback_segs  c,
     v$transaction      d
     v$session e
see code depot for full script
where  
   a.object_id =  b.object_id
 and
   a.xidusn    =  c.segment_id
and
   a.xidusn    =  d.xidusn
and
   a.xidslot   =  d.xidslot
and
   d.addr      =  e.taddr;

So, where do we get these other undo segments? We create an undo tablespace with the create undo tablespace command (we will talk about tablespaces in more detail next) and Oracle Database 10g will create the undo segments and manage the for us automatically.

When an Oracle Database is first created, an undo tablespace can be created at that time, and we recommend this approach. Before you can use the undo tablespace, we need to set a few parameters (see, there are those parameters again, they show up everywhere!)

You can use the alter system command to change any of the parameters listed above at any time.

However, please note that if you change the Undo Tablespace by changing the undo_tablespace parameter, there still may be active transactions against the old tablespace.  Keep that in mind before you drop it, it could result in one of the DBA’s most common errors: ORA-01555, snapshot too old, rollback segment too small!

This is an excerpt from the bestselling "Easy Oracle Jumpstart" by Robert Freeman and Steve Karam (Oracle ACE and Oracle Certified Master).  It’s only $19.95 when you buy it directly from the publisher here.

 
 
  Guarantee your Success!

Oracle is the world's most complex, robust and flexible database, considered impossible to master without a mentor.

That's why all BC Oracle trainers are working professionals, experts in Oracle who share their tips and secrets.

 


 

 

  
 

 
 
 
 
Oracle performance tuning software
 
 

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2012 

All rights reserved.

Oracle © is the registered trademark of Oracle Corporation.