Rollback and UNDO

Hi,
I'm confuse about Rollback and Undo concepts, can some one explain it to me please?
Felipe :)

This is a copy of a previous post I made some time ago:
There might be confusion while undo and rollback segment terms are used interchangeably in db world. It is due to the compatibility issue of oracle.
Undo
Oracle Database must have a method of maintaining information that is used to roll back, or undo, changes to the database. Such information consists of records of the actions of transactions, primarily before they are committed. These records are collectively referred to as undo.
Undo records are used to:
* Roll back transactions when a ROLLBACK statement is issued
* Recover the database
* Provide read consistency
* Analyze data as of an earlier point in time by using Flashback Query
When a ROLLBACK statement is issued, undo records are used to undo changes that were made to the database by the uncommitted transaction. During database recovery, undo records are used to undo any uncommitted changes applied from the redo log to the datafiles. Undo records provide read consistency by maintaining the before image of the data for users who are accessing the data at the same time that another user is changing it.
Undo vs Rollback
Earlier releases of Oracle Database used rollback segments to store undo. Oracle9i introduced automatic undo management, which simplifies undo space management by eliminating the complexities associated with rollback segment management. Oracle strongly recommends (Oracle 9i and on words) to use undo tablespace (automatic undo management) to manage undo rather than rollback segments.
To see the undo management mode and other undo related information of database-
SQL> show parameter undo
NAME TYPE VALUE
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
Since the advent of Oracle9i, less time-consuming and suggested way is—using Automatic Undo Management—in which Oracle Database creates and manages rollback segments (now called “undo segments”) in a special-purpose undo tablespace. Unlike with rollback segments, we don’t need to create or manage individual undo segments—Oracle Database does that for you when you create the undo tablespace. All transactions in an instance share a single undo tablespace. Any executing transaction can consume free space in the undo tablespace, and when the transaction completes, its undo space is freed (depending on how it’s been sized and a few other factors, like undo retention). Thus, space for undo segments is dynamically allocated, consumed, freed, and reused—all under the control of Oracle Database, rather than manual management by someone.
Switching Rollback to Undo
1. We have to create an Undo tablespace. Oracle provides a function (10g and up) that provides information on how to size new undo tablespace based on the configuration and usage of the rollback segments in the system.
DECLARE
utbsiz_in_MB NUMBER;
BEGIN
utbsiz_in_MB ;= DBMS_UNDO_ADV.RBU_MIGRATION;
end;
CREATE UNDO TABLESPACE UNDOTBS
DATAFILE ‘/oradata/dbf/undotbs_1.dbf’
SIZE 100M AUTOEXTEND ON NEXT 10M
MAXSIZE UNLIMITED RETENTION NOGUARANTEE;
Note: In undo tablespace creation, “SEGMENT SPACE MANAGEMENT AUTO” can not be set
2.Change system parameters
SQL> alter system set undo_retention=900 scope=both;
SQL> alter system set undo_tablespace=UNDOTBS scope=both;
SQL> alter system set undo_management=AUTO scope=spfile;
SQL> shutdown immediate
SQL> startup
UNDO_MANAGEMENT is a static parameter. So database needs to be restarted.
Reference: 10gR2 Administration Guide and Concepts
Regards,
Francisco Munoz Alvarez

Similar Messages

  • Tablespace, Rollback segments and Undo tablespace

    hi,
    we are frequently getting an error on tablespaces, rollback segments and undo tabelspaces during the ETL load. This was really distrubing us to go further, is there any best practice how to avoid the tablespace errors or any precautions to be taken, we are very new to this ETL loads, pls advice
    Kishan

    Hello Kishan
    Yes. Make tablespaces bigger. However, the proper way to do it is optimizing your queries. If you don't have experience with Oracle DB, consult your DBA.
    Hope this helps
    Mate

  • Differance between Rollback Segements and Undo Tablespace/segments

    Hi everyone.
    I have some confusion that how Rollback Segements and Undo Tablespace/segments and different? Functionally they seem to be the same but why then Oracle recommends not using Rollback segments?...please explain. Kindly post any links useful in this regard.
    Thanks,
    Mukesh

    1.when does the changed data written to the undo tablespace?It never gets moved to the undo tablespace.
    The ORIGINAL data gets moved to the rollback/undo. Oracle assumes that most of the time the transaction is going to commit, so the change is made to the real block (in memory). At that time, enough information to roll back that change is written into the rollback segment.
    2.which process writes the changed data to the undo tbs?The server process. The one to which the user connects. The one the user gets by contascting the listener.
    3.What are the identifiactions which is used to undo the changes made(like SCN) ? plz...AFAIK, Transaction Id is the only thing used. SCN, a redo log construct, may be used to recreate the transaction ID in the rollback.

  • Difference Between Rollback Segments and UNDO Tablespace

    Hi guys,
    Can you tell difference between Rollabck segments and UNDO Tablespaces.
    I think that rollback Segemnts and UNDO tablespaces are similar both are used for storing before imags of data, which is going to be modified.
    but my question still both the rollback abck segments and UNDO tablespaces exists.
    why and what is the reason of both existing and at what time, we can use..them at which scenarios's
    Regards,
    Pavan Kumar N

    Undo segments in undo tablespaces, introduced in 9i, are the successor of rollback segments.
    They are automatically managed by Oracle.
    Rollback segments exist for reasons of backwards compatibility.
    That said, you should switch to undo segments and stop using rollback segments.
    Other than that: could you please avoid rehearsing the complete documentation in this forum?
    Sybrand Bakker
    Senior Oracle DBA

  • Is there a way to rollback or undo the actions committed by remediation?

    For example, we create a configuration item to check if anti-virus service is present and running on our application servers, and if it is not, to remediate the condition by starting the service.  We deploy this CI in a baseline to a collection and
    several servers are found to be non-compliant.  The deployment remediates the condition by starting the AV service which subsequently causes the servers to blue screen. Questions:
    How do we rollback or undo the remediation?  Do we remove the CI from the Evaluation Conditions in the baseline? or change revision? 
    What is the affect of this - are settings on the servers returned to their previous state?

    You can't rollback or undo the remediation. You can remove the Remediate noncompliant rules when supported
    checkbox in the deployment, but that won't undo previous remediation's. It will only prevent future remediation's.
    See point 1, it won't return the server to the previous state. To do that you need to create a custom script, or a configuration item that does exactly the opposite.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Difference between roll back and undo segment.

    Hi ,
    Oracle 10.2.0.1.0
    whats the difference between roll back and undo segemnt ? are they one and same as per changing version of oracle ? please help

    Hi,
    Both will do the same functionality,but in oracle 9i they made it simplify ,because if u are using rollback segments ,u need to put them online in init.ora and u need to take care space management etc.
    so in oracle 9i they introduced undo tablespaces on that u can creage undo segments and space management will be take care by oracle managed files ,so its reduces the burden of dba
    Regards,
    Simma....

  • I erroneously deleted some background icons, that now have left me with only thumbnail images, what appears when I want to enlarge is a grey circle containing a black exclamation symbol, how can I get back full function and undo my mistake

    I have erroneoulsy deleted icons repetious images from the computer which then affected my iphoto images, leaving me in some cases only with the thembnail image.   When I try to enlarge or perform any other function all that appears is a black field containing a grey circle with a black exclamation symbol( !)
    within it.  How to I get back full function of these affected images and undo my goof up.   I have tried restore, but my attempts have not proved successful. 
    Help !!!
    silvercoho

    What exactly did you do to delete these?
    How did you try to "restore" and what did you try to restore?
    Probably the only solution is to restore your backup of the iPhoto library  from before you did this
    LN

  • Why do the "SAVE", "SAVE AS" and "UNDO" functions of InDesign CS6 stop working after a short time?

    Why do the "SAVE", "SAVE AS" and "UNDO" functions of InDesign CS6 stop working after a short time?

    Normally they don't. You might have some sort of problem on your system, possibly a conflict with other software, or corrupt ID prefs or application. Trashing the prefs is easy, and good place to start: Replace Your Preferences
    It will help if you tell us the OS version, whther you've installed the 8.0.1 patch, and how you are trying to access the commands, and what happens when you do. Is this isolated to one file, or does it happen with all files?

  • How do I copy and paste to my mac and undo the change attributes like I do withmy iPad. I cannot shake my mac?

    How do I copy and paste to my mac and undo the change attributes. On my ipad I can shake it and undo the change attributes but not sure how to do this on the imac? Example Excel to email and undo changes?

    Thanks for the information....It did not work,....
    I am copying information from Excel and posting it into Lotus
    It works fine in word and other application, just not in Lotus notes...
    Any other ideas?

  • How best we can use the Rollback and RollbackAlways mechanism in Visual Studio Release Management Template

    Hello All,
    We need a clarification on Rollback and RollbackAlways in Release template.
    We checked a scenario for Rollback and RollbackAlways:
    In Release Template, we have the first activity as “Configure Application Pool” and then followed by a rollback action of “Create Application Pool”
    and “Create Web Site” then followed by "Code Deployment" via TFS build.
    We tested with 2 scenario’s:
    With App Pool and Web Site already existing: when triggered the build, configure
    app pool succeeded, then Rollback action was skipped (as previous action was successful), finally deploy the code executed (code deployed) and build got succeeded.
    Deleted App Pool and Web Site: when triggered the build, configure app pool failed (as no app pool existed), Rollback action executed (as previous action failed) – created app pool and web site then finally
    deploy the code executed (code deployed)
    But build failed (Error: Configure app pool action failed).
    Ideally the build should succeed as the roll back action got executed and code deployed successfully.
    Please correct us if our understanding is wrong.
    Also, Kindly let us know how best we can use the Rollback and RollbackAlways mechanism in Release Management
    Looking forward for your positive response.
    Thanks in advance.
    Regards,

    Hi Shashank,
    Rollback Always runs if any of the actions in the template failed. Rollback will run if action just above rollback fails or if any of the actions below the Rollback fails.
    Article here (http://www.incyclesoftware.com/2014/03/understanding-rollbacks-release-management/) clearly explains how Rollback and Rollback
    Always work.
    I think you come across this issue since you are using build to do the "code deployment" action. You should use the release template to do that. 
    As far as I know you cannot use Rollback to achieve condition check (App pool exist in your case) action.
    For this you can create your own Power Shell component (which checks if the app pool exist and is not create it) and add it as a tool in RM server (RM Server Inventory).
    Another option is you can follow the workaround in below thread "Answer" quoted below. That is execute Remove app pool regardless if it exist or not (which does not fail) and then create app pool.
    I was able to get it working by removing the app pool which does not fail if it doesn't exist. Removing then creating seems the long way around but it works.
    Flow:
    Remove Application Pool
    Create Application Pool
    https://social.msdn.microsoft.com/Forums/en-US/43bf21c8-e233-4e58-a5a8-2592b78bc466/vs-2013-release-management-create-application-pool-fails-if-it-already-exists?forum=tfsbuild
    Cheers!
    Chaminda

  • Forms editing and undos

    Acrobat 8 Pro, OS X 10.5.7
    Acrobat does not appear to able to undo an action when editing forms. A co-worker is working on a multipage form that was created in ID and exported to PDF. In Acrobat, she is creating form fields. Inadvertently, she has selected all of the fields and deleted them with no option to undo that last action.
    I've checked Acrobats preferences and there does not appear to be an option to edit the number of undo's.
    Can Acrobat undo actions when editing form fields?
    Thanks.

    PjonesCET wrote:
    If she closed the file she had to save the changes to retain them. That's what I was trying to get at once you save a File, you have the changes and they can never be undone.
    Oh Phillip. Do you really think no one reads your posts? You mention no such thing in post #3 or any of your following posts.
    Do you need new oars so you can backpaddle?
    Here are your posts:
    PjonesCET wrote:
    It appears the person save the changes once changes are save there are no undo.  That;s the reason I suggested making a Backup of a document before making any major changes. I know of no application that once you do a save or save as can go back and undo anything.
    PjonesCET wrote:
    Maybe I am not saying right. I know of no application once you save a Document, that will allow you to undo an edit.
    PjonesCET wrote:
    If you still don't understand I give up.  Once saved  a document, when you go to edit menu and undo its unavailable (Grayed out), not active.
    (sorry folks. I don't mean to stir things up in your thread but PJ has a tendency to spread misinformation all over the place. I just think it's good to call him on it when it happens.)

  • Authorization object for "set TECO" and "undo TECO"

    We want to control the authorization for "set TECO" and "undo TECO",but we can't find relevant Authorization object. Is there any Authorization object  for these two functions? If there's no Authorization object for them ,then how can we achieve the same result? Thank you very much!

    Hi,
    Under one user ID the auth object B_USERSTAT will have the authorization key in which user will be responsible to change the TECO user status.
    One user will not have any authorization key under B_USERSTAT Auth_Object.
    Hope it's will give you help.
    Regards,
    Vishal Kr. Sharma

  • Rollback and Scheduling in Database?

    If we use the Timestamp Ordering for concurrency control in following scheduling:
    http://oi59.tinypic.com/260361k.jpg
    My note says T2,T3,T5 is Run and T4,T5 is Rollback. I think it's false. any expert could help us? (i.e, in this schedule which of the Transaction Rollback and which one Is Done?

    ISolation Level is not defined. would you please a default setting and consider more hint for me? why some rollback in this senario ?
    default is read committed isolation. you are not helping us and yourself by not posting the details.
    please post actual sql statements.. you can replace actual table names/column names to dummy names...
    in forums, people(answerers) already do some sort of half guesses  to interpret on question - on what might be issue(s).  you can help us and yourself by providing more details and sql statements...
    Hope it Helps!!

  • Macbook pro charger light flickering, tried smc reset and undoing cord in back inside computer, nothing working....

    I have tried to do everything I can find in previous forums, ex: smc reset, removing back panel and undoing cord for a min, nothing seems to work, any ideas please.

    There are no settings Readers can suggest you change for different results.
    Your appointment at the Genius Bar for an evaluation is FREE, in warranty or out. These guys put their hands on these Macs all day every day, and Power and other Physical Problems is what they are good at.
    Plus they have lots of spare parts they can swap around to figure out what it is doing in a hurry.

  • How do I uninstall Windows 7 and undo my partition?

    How do I uninstall Windows 7 and undo my partition? I don't use Windows 7 anymore and would like the space back.

    Partition is gone but my computer is sitll trying to boot to the window sides (it did this automatically before). It works fine when I hit the Option key and select the Mac (the only option), but do you know why it would still try and boot to the other side. I just got a black screen that told me to insert a disk.

Maybe you are looking for

  • How can I view my full billing history for the app and music stores without iTunes installed?

    I just received an email receipt from Paypal showing a $12.99 purchase from iTunes. I almost NEVER purchase anything over around five dollars in the app or music store. Since PayPal does not show what this purchase was for, I have not received the re

  • Windows XP Pro problem

    I need some advice. I bought Core Java I by Horstmann, but downloaded Java from Sun's website because the disk did not have everything I needed. I was previously able to run Java programs on a Windows 95 machine. I now have a Windows XP Pro machine.

  • Broken link to Presenter 8 Trial download

    Broken link to trial:  https://www.adobe.com/cfusion/tdrc/index.cfm?product=presenter How about "Request Information", maybe some one can send me a good link? https://www.adobe.com/cfusion/mmform/index.cfm?name=contact_us&sa=elearning Another Broken

  • Slow iMac since upgrading to Yosemite

    My iMac seems to be showing me lots of color wheels and is slow to start and shutdown.  Here is the etrecheck log and advice would be greatly appreciated.  Thank you, John EtreCheck version: 2.1.6 (109) Report generated January 25, 2015 at 8:28:23 AM

  • Curve 9300 White screen problem, PLEASE HELP!

    Hi guys, so basically, I've been having this problem for a little while now of which my phone freezes at a random stage, white screens with the red LED light ON and reboots itself. I have tried several things from this forum so far. I have backed up