473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

Jul 19 '05 #1
5 12834
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..
Jul 19 '05 #2
Varol,
Thanks very much...I'll talk to DBA about using a bigger segment with
SET TRANS...

Thanks again
Tomas
"varol cavdar" <va***@bilisim-ltd.com.tr> wrote in message
news:e0**************************@posting.google.c om...
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..

Jul 19 '05 #3
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

Jul 19 '05 #4
"tkestell" <tk******@attbi.com> wrote in message news:<lSPKa.28822$3d.17163@sccrnsc02>...
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 ?
http://www.jlcomp.demon.co.uk/faq/active_rollback.html

HTH -- Mark D Powell --
Jul 19 '05 #5
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" <da*************@hotmail.com> wrote in message
news:37************************@posting.google.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

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alice | last post by:
Hi all, Given a rollback segment with storage as follows : Initial Extent 5 MB Next Extent 5 MB Min Extents 20 Does this mean that every time a transaction uses this rollback segment it...
2
by: Alice | last post by:
Hi all, I have a problem with rollback segment. I am a beginner and do not have much knowledge of DBA. Anyways, the problem is there is a transaction of around 105 MB. This would not fit...
2
by: Gert Schumann | last post by:
I want to delete just parts of tables, so I can't use 'TRUNCATE'. As I want to delete about millions of lines, I need a very big rollback segment. The best way would be to delete without using...
1
by: Susan Lam | last post by:
Hi, I am an Oracle developer and new to SqlServer. Is there rollback segment in SqlServer? If there is, does it use only for the purpose of rollback or to maintain read consistency as well? ...
0
by: minapatel | last post by:
I have the following procedure CREATE OR REPLACE procedure FOL_PURGE_CASES as /* type "SET SERVEROUTPUT ON" in sqlplus to debug !! */ cursor all_cases is cursor all_cases is ...
0
by: kinglalit | last post by:
Hi, My DBA wants to turn off the explicit rollback segments currently being used and replace them by UNDO segment. I have explicit mention of these rollback segments in my C++ and Pro*C codes....
1
by: julietmachiwa | last post by:
I ran a troubled script on rollback segment and the whole rollback segment is returned as being full. How do I correct this>
1
by: julietmachiwa | last post by:
I ran a troubled script on rollback segment ans is reutrned as being full. How do I correct this ?
5
by: tkestell | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.