Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Undo Management

Re: Undo Management

From: Terminator <kramakrishnabest_at_gmail.com>
Date: 26 Aug 2005 05:09:01 -0700
Message-ID: <1125058141.647581.275440@f14g2000cwb.googlegroups.com>


Undo Tablespace instead of Rollback Segments Historically, Oracle has used rollback segments to store undo. Space management for these rollback segments has proven to be quite complex. Oracle now offers another method of storing undo that eliminates the complexities of managing rollback segment space, and enables DBAs to exert control over how long undo is retained before being overwritten. This method uses an undo tablespace.
You cannot use both methods in the same database instance, although for migration purposes it is possible, for example, to create undo tablespaces in a database that is using rollback segments, or to drop rollback segments in a database that is using undo tablespaces. However, you must shutdown and restart your database in order to effect the switch to another method of managing undo. Rollback Segment in SYSTEM Tablespace
Oracle always uses a SYSTEM rollback segment for performing system transactions. There is only one SYSTEM rollback segment and it is created automatically at CREATE DATABASE time and is always brought online at instance startup. You are not required to perform any operations to manage the SYSTEM rollback segment. Create a Database with an Undo Tablespace You can create a specific undo tablespace using the UNDO TABLESPACE clause of the CREATE DATABASE statement. CREATE DATABASE VEN1

        CONTROLFILE     REUSE
        MAXDATAFILES    256
        MAXINSTANCES    4
        MAXLOGFILES     62
        MAXLOGMEMBERS   5
        MAXLOGHISTORY   1600
        CHARACTER SET   "UTF8"
        NATIONAL CHARACTER SET   "UTF8"
        DATAFILE  '/u01/sys/VEN1_sys1.dbf' SIZE 300M REUSE
        UNDO TABLESPACE undo DATAFILE '/u01/sys/VEN1_undo1.dbf'
          SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
        DEFAULT TEMPORARY TABLESPACE tmp
          TEMPFILE '/u01/tmp/VEN1_tmp1.dbf' SIZE 512064K REUSE
          EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K
LOGFILE GROUP 1 ('/u01/rdo/VEN1_log1A.rdo',
                 '/opt/rdo/VEN1_log1B.rdo') SIZE 10M REUSE,
        GROUP 2 ('/u01/rdo/VEN1_log2A.rdo',
                 '/opt/rdo/VEN1_log2B.rdo') SIZE 10M REUSE,
        GROUP 3 ('/u01/rdo/VEN1_log3A.rdo',
                 '/opt/rdo/VEN1_log3B.rdo') SIZE 10M REUSE,
        GROUP 4 ('/u01/rdo/VEN1_log4A.rdo',
                 '/opt/rdo/VEN1_log4B.rdo') SIZE 10M REUSE,
        GROUP 5 ('/u01/rdo/VEN1_log5A.rdo',
                 '/opt/rdo/VEN1_log5B.rdo') SIZE 10M REUSE,
        GROUP 6 ('/u01/rdo/VEN1_log6A.rdo',
                 '/opt/rdo/VEN1_log6B.rdo') SIZE 10M REUSE;
In the ALERT log, you can see, that a SYSTEM Rollback segment is created:
create rollback segment SYSTEM tablespace SYSTEM   storage (initial 50K next 50K)
Completed: create rollback segment SYSTEM tablespace SYSTEM Several Undo Segments are automatically allocated CREATE UNDO TABLESPACE UNDO DATAFILE '/u01/sys/VEN1_undo1.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED Fri Jul 27 08:56:49 2001
Created Undo Segment _SYSSMU1$
Created Undo Segment _SYSSMU2$
Created Undo Segment _SYSSMU3$
Created Undo Segment _SYSSMU4$
Created Undo Segment _SYSSMU5$
Created Undo Segment _SYSSMU6$
Created Undo Segment _SYSSMU7$
Created Undo Segment _SYSSMU8$
Created Undo Segment _SYSSMU9$
Created Undo Segment _SYSSMU10$

Undo Segment 1 Onlined
Undo Segment 2 Onlined
Undo Segment 3 Onlined
Undo Segment 4 Onlined
Undo Segment 5 Onlined
Undo Segment 6 Onlined
Undo Segment 7 Onlined
Undo Segment 8 Onlined
Undo Segment 9 Onlined
Undo Segment 10 Onlined
Successfully onlined Undo Tablespace
Completed: CREATE UNDO TABLESPACE UNDO DATAFILE Obsolete INIT.ORA parameters when using an Undo Tablespace
undo_management = AUTO
undo_retention = 10800
undo_tablespace = undo

More Information can be found in the Oracle9i Database Administrator's Guide
Release 1 (9.0.1) "Managing Undo Space".  New Space Management in Locally Managed Tablespaces Prior to Oracle8i, all tablespaces were created as dictionary-managed. Dictionary-managed tablespaces rely on SQL dictionary tables to track space utilization. Beginning with Oracle8i, you can create locally managed tablespaces, which use bitmaps (instead of SQL dictionary tables) to track used and free space.
Beginning with Oracle9i you can specify how free and used space within a segment is to be managed. Your choices are:

shirleyr_at_mailings.com wrote:
> Hi,
>
> I did most of my work on Oracle 8i using rollback segments. I just
> took a new job where they didn't have a DBA before and are using Oracle
> 9i and 10g. They have Undo tablespaces instead of rollback segments.
> Does undo tablespaces work like rollback segements? Can someone point
> me to some reading to explain how they should be set up and how they
> work. We have a long transaction that has been running at night and it
> gets 'snapback too old' error message. But I don;t know how the undo
> is working. Should I remove all the undofile to have just one undofile
> to use all the space for this transaction?
Received on Fri Aug 26 2005 - 07:09:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US