DBAsupport.com Forums - Powered by vBulletin
Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Disable Autocommit for DDL statements

  1. #11
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    You can do an online move of the tables. Asktom has some answers oin how to do it.

    asktom.oracle.com

    It still seems like you are wasting your time. Did the tables and indexes shrink due to a recent purge? Do you expect that they will grow again? Well, if they grow again they will only reallocate all of the space that you are trying to save. If you need disk space buy another raid array. This will allow you spread out the data on more disks. You can always add another datafile.

  2. #12
    Join Date
    Mar 2006
    Posts
    7
    I appreciate the previous comment, but this is what I need to do. Should I assume from the responses that there is no way to disable autocommit for DDL or no other Oracle tools that will allow a rollback of DDL statements.

    It is unfortunate because I can do this with other RDBMS such as SQLServer and effectively.

    Thanks to all who contributed; I do value the feedback.

  3. #13
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Quote Originally Posted by muck_isl
    I appreciate the previous comment, but this is what I need to do. Should I assume from the responses that there is no way to disable autocommit for DDL or no other Oracle tools that will allow a rollback of DDL statements.
    You are asking the Oracle Corp to rewrite the kernel code.

    It is unfortunate because I can do this with other RDBMS such as SQLServer and effectively.
    You are comparing apple with orange.

    Tamil

  4. #14
    Join Date
    Apr 2006
    Posts
    50
    there's no way to disable 'autocommit' as you call it.

    first step is to write the ddl script to undo the changes you're going to make.

    if you write the undo script in the reverse order of the original script then you should be able to run it anyway. The steps that you're original script didn't get upto will just fail in the reverse script as it won't be able to perform the required action.

    i.e. you try to drop a table that didn't get created or recreate a synonym that was never dropped.

    I'm trying to think of a problem with this method, where you could actually do damage by trying to undo something that wasn't performed. off the top of my head I can't but you may find that undoing some of your ddl may be difficult. i.e. truncating a table (so make a copy in the original script).

    sounds like a lot of work and testing anyway. put some thought into how you would reverse each step and go from there.

  5. #15
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    How about taking a backup before the upgrade, then restoring if you need to rollback? Seems like you'd be doing the first part of that anyway.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  6. #16
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Quote Originally Posted by slimdave
    How about taking a backup before the upgrade, then restoring if you need to rollback? Seems like you'd be doing the first part of that anyway.
    Or just write the script so that it can be run more than once without corrupting anything.

  7. #17
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Cool


    Or use OEM Change Manager -- It rollback anything.
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  8. #18
    Join Date
    Mar 2006
    Posts
    7
    Well, if OEM change manager will roll it back then there must be a way to do it with out autocommit - yes? Is there some way to identify the transaction information after each autocommitted DDL statement such that if I wanted to roll them back I could have Oracle roll-em back. I'd much prefer to rely upon Oracle than my own "undo" scripts. Thanks for the feedback!

  9. #19
    Join Date
    Mar 2006
    Posts
    7
    ......of course if it is has already been autocommitted you probably cannot roll it back at the transaction level. So probably a dumb question.

  10. #20
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Quote Originally Posted by muck_isl
    Well, if OEM change manager will roll it back then there must be a way to do it with out autocommit - yes?
    Not through rollback though, but by issuing other DDL to reverse the effects of the previous statements. Sometimes this is straightforward, like dropping an index you just created, but sometimes it is not. for example, if you drop a column of a table then the only way to get that data back is to have backed up the complete table (or the PK + that column) and then run some complex scripts to restore the data.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width