Attempting to Access a LOB value in a PLSQL local Variable after TRUNCATE Fails With: ORA-01555: snapshot too old (Doc ID 1531581.1)

Last updated on FEBRUARY 25, 2013

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.8 and later
PL/SQL - Version 9.2.0.8 and later
Information in this document applies to any platform.

Symptoms

Attempting to access a LOB value in a PLSQL local variable after TRUNCATE fails with:

ORA-01555: snapshot too old


For Example:

 DECLARE
  TYPE TROW IS TABLE OF TERRAUDITARMHISDIS%ROWTYPE INDEX BY PLS_INTEGER;
  TROWS TROW;
BEGIN
  SELECT * BULK COLLECT INTO TROWS
  FROM TERRAUDITARMHISDIS_TMP2 TFNAMD  
  WHERE ROUND(MONTHS_BETWEEN(SYSDATE,TFNAMD.DATSYS ))<=3;
  EXECUTE IMMEDIATE 'TRUNCATE TABLE TERRAUDITARMHISDIS_TMP2';
  FORALL I IN 1..TROWS.COUNT
    INSERT INTO TERRAUDITARMHISDIS_TMP2 VALUES TROWS(I);
 END;
END;
/

 

ERROR at line 1:
ORA-01555: snapshot too old: rollback segment number  with name "" too small
ORA-22924: snapshot too old
ORA-06512: at "SCOTT.P_PURGE_TAB_1555", line 14
ORA-06512: at line 1

 

 

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms