Rollback Segment Errors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tkestell

    Rollback Segment Errors

    Is their anyway to perform mass deletes (several million records) without
    "maxing out" rollback segments?

    I'm working on archiving data from an Oracle 8.1.7 database The system is
    about 4 years old and no data has EVER been archived /removed. So the
    two largest tables contain well over 25 million records!

    As part of the archive process I'm deleting out-dated records, but because
    of the sheer volume keep receiving "Unable to extend Rollback Segment
    errors." I've tried to commit every 50 deletes, I've even tried committing
    after
    every single delete, but eventually always receive this error. Our DBA
    does not want to extend the rollback segments (probably with good reason).

    This process will run off-hours, so there's no conflict with end-users.

    TIA for any insights you can provide.
    Tomas



  • varol cavdar

    #2
    Re: Rollback Segment Errors

    Hi Tomas
    The only way to delete table records without using a rollback
    segment is to use truncate command. In this case all records in your
    table will be deleted and committed implicitly.

    Another method is to select a bigger rollback segment. To do this
    you should use "SET TRANSACTION USE ROLLBACK SEGMENT rbig;" command at
    the begining of your transaction. If rbig is big enough then you can
    delete much more records at a time

    best regards..

    Comment

    • tkestell

      #3
      Re: Rollback Segment Errors

      Varol,
      Thanks very much...I'll talk to DBA about using a bigger segment with
      SET TRANS...

      Thanks again
      Tomas
      "varol cavdar" <varol@bilisi m-ltd.com.trwrote in message
      news:e014aa93.0 306270348.6f893 ae9@posting.goo gle.com...
      Hi Tomas
      The only way to delete table records without using a rollback
      segment is to use truncate command. In this case all records in your
      table will be deleted and committed implicitly.
      >
      Another method is to select a bigger rollback segment. To do this
      you should use "SET TRANSACTION USE ROLLBACK SEGMENT rbig;" command at
      the begining of your transaction. If rbig is big enough then you can
      delete much more records at a time
      >
      best regards..

      Comment

      • Daniel Roy

        #4
        Re: Rollback Segment Errors

        The most efficient way to perform "mass deletes" is to truncate. If
        you have to delete all the records, it's very efficient and
        straightforward . If you need to keep only a portion of the existing
        records in a table, the way I would try to handle it is by
        disabling/dropping the indexes, copying the records to be kept in a
        temporary table (and I DON'T mean temporary in the Oracle sense, but
        in the conceptual sense), truncate or drop the initial table, and
        finally recopy the records from the "temporary" to the initial table.
        Use "create table ... as select ... where ..." to move records around.
        Truncate the initial table if there is something worth keeping
        (grants, triggers, procedures referencing it, extents allocated to it,
        constraints, ...), otherwise just drop it. Don't forget to rebuild the
        indexes and constraints (if applicable) afterwards.

        Daniel
        Is their anyway to perform mass deletes (several million records) without
        "maxing out" rollback segments?
        >
        I'm working on archiving data from an Oracle 8.1.7 database The system is
        about 4 years old and no data has EVER been archived /removed. So the
        two largest tables contain well over 25 million records!
        >
        As part of the archive process I'm deleting out-dated records, but because
        of the sheer volume keep receiving "Unable to extend Rollback Segment
        errors." I've tried to commit every 50 deletes, I've even tried committing
        after
        every single delete, but eventually always receive this error. Our DBA
        does not want to extend the rollback segments (probably with good reason).
        >
        This process will run off-hours, so there's no conflict with end-users.
        >
        TIA for any insights you can provide.
        Tomas

        Comment

        • Mark D Powell

          #5
          Re: Rollback Segment Errors

          "tkestell" <tkestell@attbi .comwrote in message news:<lSPKa.288 22$3d.17163@scc rnsc02>...
          Is their anyway to perform mass deletes (several million records) without
          "maxing out" rollback segments?
          >
          I'm working on archiving data from an Oracle 8.1.7 database The system is
          about 4 years old and no data has EVER been archived /removed. So the
          two largest tables contain well over 25 million records!
          >
          As part of the archive process I'm deleting out-dated records, but because
          of the sheer volume keep receiving "Unable to extend Rollback Segment
          errors." I've tried to commit every 50 deletes, I've even tried committing
          after
          every single delete, but eventually always receive this error. Our DBA
          does not want to extend the rollback segments (probably with good reason).
          >
          This process will run off-hours, so there's no conflict with end-users.
          >
          TIA for any insights you can provide.
          Tomas
          Tomas, if you are commiting as you go you should not be getting an
          'unable to extend' error unless your rbs tablespace is badly
          fragmented and some segments have no room to grow at all, or the
          maximum size of your rbs segmens is less than the amount of data you
          are trying to purge.

          May I suggest you first verify that your rbs tablespace/segments do
          not require manual intervention to clean them up. I would suggest
          running multiple purges with each purge going after the oldest data
          such as data < 3.75 yrs, then 3.5, then 3.25 or similar where the
          amount of data in each pass will fit in the maximum size of a rollback
          segment.

          You may want to allocate a special large rbs segment just to support
          this process. The following article may be of interest:

          How do I associate an active session with a rollback segment ?


          HTH -- Mark D Powell --

          Comment

          • tkestell

            #6
            Re: Rollback Segment Errors

            Daniel,
            The more people I talk with the more it sounds like the majority of
            DBA types consider your solution the better and most efficient one.

            Thanks for your insight ... I'll pursue your suggestions.
            Tomas


            "Daniel Roy" <danielroy10jun k@hotmail.comwr ote in message
            news:3722db.030 6270541.7b855ab 9@posting.googl e.com...
            The most efficient way to perform "mass deletes" is to truncate. If
            you have to delete all the records, it's very efficient and
            straightforward . If you need to keep only a portion of the existing
            records in a table, the way I would try to handle it is by
            disabling/dropping the indexes, copying the records to be kept in a
            temporary table (and I DON'T mean temporary in the Oracle sense, but
            in the conceptual sense), truncate or drop the initial table, and
            finally recopy the records from the "temporary" to the initial table.
            Use "create table ... as select ... where ..." to move records around.
            Truncate the initial table if there is something worth keeping
            (grants, triggers, procedures referencing it, extents allocated to it,
            constraints, ...), otherwise just drop it. Don't forget to rebuild the
            indexes and constraints (if applicable) afterwards.
            >
            Daniel
            >
            Is their anyway to perform mass deletes (several million records)
            without
            "maxing out" rollback segments?

            I'm working on archiving data from an Oracle 8.1.7 database The system
            is
            about 4 years old and no data has EVER been archived /removed. So the
            two largest tables contain well over 25 million records!

            As part of the archive process I'm deleting out-dated records, but
            because
            of the sheer volume keep receiving "Unable to extend Rollback Segment
            errors." I've tried to commit every 50 deletes, I've even tried
            committing
            after
            every single delete, but eventually always receive this error. Our DBA
            does not want to extend the rollback segments (probably with good
            reason).

            This process will run off-hours, so there's no conflict with end-users.

            TIA for any insights you can provide.
            Tomas

            Comment

            Working...