Hi. Relative pl/sql newbie here. This update script with a commit loop is just about to drive me insane. I've lowered the interval to every 1000, but I'm still running out of roll back segments (ORA-01562: failed to extend rollback segment number 10
ORA-01628: max # extents (200) reached for rollback segment LG_RB3). I'm beginning to think adjustments need to be made on the server end, like increasing rollback segment size, but more than likely I've got a stupid error in my code. Anybody see what's wrong with it?
DECLARE
commit_interval NUMBER := 1000;
v_count NUMBER := 0;
CURSOR mile_cursor IS
Select begin_mp, length, end_mp
from pavement.pcs2002;
BEGIN
FOR rec_miles IN mile_cursor
LOOP
UPDATE pavement.pcs2002 SET length = 4;
v_count := v_count + 1;
IF v_count >= commit_interval THEN
COMMIT;
v_count := 0;
close mile_cursor;
open mile_cursor;
END IF;
END LOOP
COMMIT;
END;
ORA-01628: max # extents (200) reached for rollback segment LG_RB3). I'm beginning to think adjustments need to be made on the server end, like increasing rollback segment size, but more than likely I've got a stupid error in my code. Anybody see what's wrong with it?
DECLARE
commit_interval NUMBER := 1000;
v_count NUMBER := 0;
CURSOR mile_cursor IS
Select begin_mp, length, end_mp
from pavement.pcs2002;
BEGIN
FOR rec_miles IN mile_cursor
LOOP
UPDATE pavement.pcs2002 SET length = 4;
v_count := v_count + 1;
IF v_count >= commit_interval THEN
COMMIT;
v_count := 0;
close mile_cursor;
open mile_cursor;
END IF;
END LOOP
COMMIT;
END;