SQL Oracle error

Am trying to run this :

DECLARE
   CURSOR c1
   IS
      SELECT customer_id, num3
        FROM table1
       WHERE text1 = 'pp' AND customer_id IS NOT NULL;

   custcount        INTEGER;
   oldtext24        VARCHAR2 (80);
   commit_counter   INTEGER       := 0;
BEGIN
   FOR i IN c1
   LOOP
      SELECT COUNT (*)
        INTO custcount
        FROM table2
       WHERE customer_id = i.customer_id;

      IF custcount = 0
      THEN
         INSERT INTO table2
                     (customer_id, text24
                     )
              VALUES (i.customer_id, i.num3
                     );

         UPDATE table1
            SET text2 = 'not_found'
          WHERE text1 = 'proserv';
      ELSE
         SELECT text24
           INTO oldtext24
           FROM info_cust_text
          WHERE customer_id = i.customer_id;

         UPDATE table2
            SET text24 = i.num3
          WHERE customer_id = i.customer_id;

         UPDATE table1
            SET text2 = oldtext24
          WHERE text1 = 'ppp';
      END IF;

      commit_counter := commit_counter + 1;

      IF (commit_counter = 500)
      THEN
         commit_counter := 0;
         COMMIT;
      END IF;
   END LOOP;
END;

but i get this error:

ERROR at line 1:
ORA-01555: snapshot too old: rollback segment number 14 with name "_SYSSMU14$"
too small
ORA-06512: at line 12

any idea?

Try to pass it at a time the machine has less activity or ask you Oracle DBA to increase the undo retention of your undo tablespace (if necessary, ask your dba to make sure the space available at Operating system level is sufficient for the undo tablespace to extend, so that it is able to handle the task you are willing to process)