My Oracle Support Banner

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 16, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.8 and later
PL/SQL - Version 9.2.0.8 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A 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

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.