Friday, October 9, 2026
  • About Us
  • Contact
DBAInsight
  • Guides
    • 23ai
    • RMAN
    • 26ai
    • Patch Update
    • RMAN
    • MySQL
    • Oracle GoldenGate
  • Cloud Technology
  • Case Studies
  • Troubleshooting
  • Training & Certification
NEWSLETTER
No Result
View All Result
DBAInsight
Home Troubleshooting

ORA-01555: Snapshot Too Old – Deep Dive into Undo and Query Consistency

November 21, 2025
in Guides, Troubleshooting
2
ORA-01555: Snapshot Too Old – Deep Dive into Undo and Query Consistency
0
SHARES
640
VIEWS

ORA-01555 Snapshot Too Old is one of the most frustrating Oracle errors DBAs encounter, especially during long-running reports or heavy batch operations.
It happens when Oracle can no longer reconstruct the older version of queried data due to insufficient undo retention or aggressive undo reuse.

This error is directly linked to undo space management — specifically, Oracle’s ability to maintain read consistency for queries running over time.

Table of Contents

Toggle
    • Related posts
    • How to Transition from IT Support to Oracle Database Administration
    • Oracle 11g to 19c Upgrade: Block Change Tracking and Level 0 Backup
    • What Is ORA-01555?
    • Why It Happens – The Real Cause
    • Common Scenarios Triggering ORA-01555
    • Example: The Problem in Action
  • Step-by-Step Solution Guide
      • Step 1: Check Undo Tablespace Usage
      • Step 2: Check Undo Retention
      • Step 3: Enable Autoextend on Undo Datafiles
      • Step 4: Increase Undo Tablespace Size
      • Step 5: Avoid Commits Inside Loops
      • Step 6: Use Real-Time Undo Monitoring
      • Step 7: Recreate Undo Tablespace (If Corrupted)
    • Step 8: Tune Undo for Long Queries and Reports
    • Real-World Example
    • Best Practices to Prevent ORA-01555
    • Related Articles
    • Final Thoughts

Related posts

How to Transition from IT Support to Oracle Database Administration

How to Transition from IT Support to Oracle Database Administration

October 5, 2026
block chain tracking

Oracle 11g to 19c Upgrade: Block Change Tracking and Level 0 Backup

October 2, 2026

In this article, we’ll explore:

  • Why ORA-01555 occurs,
  • How undo retention works,
  • How to tune undo tablespace and retention settings,
  • And practical ways to prevent it in real production systems.

What Is ORA-01555?

You might see this error while running a query:

ORA-01555: Snapshot too old: rollback segment number with name "" too small

Or in newer versions:

ORA-01555: snapshot too old: rollback segment too small
ORA-30036: unable to extend segment by N in undo tablespace UNDOTBS1

Essentially, Oracle is telling you:

“The undo information I needed to reconstruct your data is gone or overwritten.”

ORA-01555 Snapshot Too Old

Why It Happens – The Real Cause

Oracle ensures read consistency by using undo records.
When a query starts, Oracle reads data as of that point in time — even if other sessions modify it later.
To maintain this view, Oracle stores the before image of changed data in the undo tablespace.

However, when:

  • Undo space is small,
  • Undo retention is too short, or
  • The undo data is reused for new transactions,

Oracle can no longer reconstruct that “old snapshot,” resulting in ORA-01555.


Common Scenarios Triggering ORA-01555

ScenarioDescription
Long-running queryThe query runs longer than undo retention, and old undo data gets overwritten.
Small undo tablespaceUndo data can’t be retained long enough to satisfy read consistency.
Frequent commits inside loopsEach commit invalidates previous undo, causing undo reuse.
High DML activityHeavy updates and inserts overwrite existing undo faster.
Undo retention misconfiguredUndo_retention too low for the workload duration.

Example: The Problem in Action

Imagine a reporting query scanning 10 million rows.
At the same time, another session is updating rows in the same table.
If the query takes 30 minutes, but undo retention is set to 900 seconds (15 minutes),
Oracle will reuse those undo blocks halfway through — leading to:

ORA-01555: snapshot too old

Step-by-Step Solution Guide

Step 1: Check Undo Tablespace Usage

Run:

SELECT tablespace_name, status, COUNT(*)
FROM dba_undo_extents
GROUP BY tablespace_name, status;

Status meanings:

  • ACTIVE: In use by ongoing transactions.
  • UNEXPIRED: Committed but still retained for read consistency.
  • EXPIRED: Available for reuse.

If most extents are EXPIRED, Oracle is reusing undo too quickly — increase undo space.


Step 2: Check Undo Retention

SHOW PARAMETER undo_retention;

If it’s low (like 900 seconds), increase it:

ALTER SYSTEM SET undo_retention=3600;

💡 Tip: Match undo_retention to your longest query duration.


Step 3: Enable Autoextend on Undo Datafiles

Ensure undo can grow as needed:

ALTER DATABASE DATAFILE '/u01/oradata/UNDOTBS01.dbf' AUTOEXTEND ON NEXT 200M MAXSIZE UNLIMITED;

Check:

SELECT file_name, autoextensible FROM dba_data_files WHERE tablespace_name='UNDOTBS1';

Step 4: Increase Undo Tablespace Size

If autoextend isn’t an option, resize manually:

ALTER DATABASE DATAFILE '/u01/oradata/UNDOTBS01.dbf' RESIZE 10G;

Or add a new file:

ALTER DATABASE ADD DATAFILE '/u02/oradata/UNDOTBS02.dbf' SIZE 5G AUTOEXTEND ON;

Step 5: Avoid Commits Inside Loops

Bad practice:

FOR rec IN (SELECT * FROM transactions) LOOP
  INSERT INTO log_table VALUES (rec.id);
  COMMIT;  -- ❌ Frequent commits cause undo reuse
END LOOP;

Best practice:

FOR rec IN (SELECT * FROM transactions) LOOP
  INSERT INTO log_table VALUES (rec.id);
END LOOP;
COMMIT;  -- ✅ Single commit after loop

Step 6: Use Real-Time Undo Monitoring

SELECT begin_time, end_time, undoblks, txncount, maxquerylen
FROM v$undostat
ORDER BY begin_time DESC;

If maxquerylen > undo_retention, increase undo retention or space accordingly.


Step 7: Recreate Undo Tablespace (If Corrupted)

In rare cases where undo segments are corrupted or fragmented:

CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE '/u02/oradata/UNDOTBS02.dbf' SIZE 5G AUTOEXTEND ON;
ALTER SYSTEM SET undo_tablespace=UNDOTBS2;
DROP TABLESPACE UNDOTBS1 INCLUDING CONTENTS AND DATAFILES;

Step 8: Tune Undo for Long Queries and Reports

For analytic or reporting systems:

  • Set undo_retention between 3600–7200 seconds.
  • Use bigger undo tablespaces (≥ 10 GB).
  • Schedule long queries during low DML activity periods.
  • Use materialized views or result cache for stable results.

Real-World Example

A retail data warehouse frequently failed during month-end reports with:

ORA-01555: snapshot too old: rollback segment too small

Diagnosis:
Undo tablespace 2GB, undo_retention 900 seconds, report runtime 45 minutes.

Fix Applied:

  • Increased undo tablespace to 10GB.
  • Set undo_retention to 4000 seconds.
  • Enabled autoextend.

✅ Result: No more snapshot errors — report runtime improved by 30% due to reduced undo I/O contention.


Best Practices to Prevent ORA-01555

  1. Size UNDO tablespace properly based on peak workload.
  2. Set UNDO_RETENTION longer than your longest query.
  3. Enable AUTOEXTEND for undo datafiles.
  4. Avoid frequent commits within loops or large PL/SQL operations.
  5. Regularly monitor v$undostat to anticipate undo growth.
  6. Schedule batch jobs during low transactional periods.
  7. Use read-only tablespaces or materialized views for reporting data.

Related Articles

  • ORA-04063 and ORA-00904 on “SYS.DBA_REGISTRY” Has Errors
  • ORA-04031: Unable to Allocate Shared Memory – Causes, Fixes, and Prevention (Oracle DBA Guide)
  • Fixing the “Error in invoking target ‘agent nmhs’ of makefile ins_emagent.mk” During Oracle 11.2.0.4 Installation on Linux

Final Thoughts

The ORA-01555: Snapshot Too Old error is not a bug — it’s a symptom of insufficient undo planning.
By properly sizing undo tablespace, tuning undo retention, and optimizing transaction behavior, you can eliminate this error entirely.

The best DBAs don’t just fix undo errors — they design systems that never experience them again.

Tags: Long-Running QueriesORA-01555Oracle 19cOracle DatabaseOracle DBAOracle UndoRead ConsistencySnapshot Too OldUndo RetentionUndo Tablespace
Previous Post

ORA-01114 / ORA-01110: Cannot Add Datafile or Write to File – Causes, Fixes & Prevention (Real Oracle DBA Guide)

Next Post

ORA-01092 and ORA-39701 While Opening Database in Upgrade Mode – Fix Guide

Next Post
ORA-01092 and ORA-39701 While Opening Database in Upgrade Mode – Fix Guide

ORA-01092 and ORA-39701 While Opening Database in Upgrade Mode – Fix Guide

Comments 2

  1. Pingback: ORA-01092 and ORA-39701 While Opening Database in Upgrade Mode – Fix Guide
  2. Pingback: ORA-01653: Unable to Extend Table or Index – Fix Tablespace Space Errors in Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR NEWS

  • Oracle Patch 38632161: Step-by-Step Guide to Upgrade Oracle 19c to Release Update 19.30

    Oracle Patch 38632161: Step-by-Step Guide to Upgrade Oracle 19c to Release Update 19.30

    0 shares
    Share 0 Tweet 0
  • How To Download And Install The Latest OPatch

    0 shares
    Share 0 Tweet 0
  • Oracle Database 19.32 Release Update (RU) Patching Guide – Patch 39472050

    0 shares
    Share 0 Tweet 0
  • How to Install Oracle 19c Database on Red Hat Enterprise Linux 9

    0 shares
    Share 0 Tweet 0
  • Installing Oracle Database 26AI on Red Hat Enterprise Linux 9

    0 shares
    Share 0 Tweet 0
  • About Us
  • Contact

© 2026 DBAInsight - Smarter Databases. Sharper Insights. DBAInsight.

No Result
View All Result
  • Home
  • Cloud & Modern DBs
  • Guides
  • Cloud Technology
  • Case Studies
  • Troubleshooting
  • Training & Certification

© 2026 DBAInsight - Smarter Databases. Sharper Insights. DBAInsight.

Add as a preferred source on Google
Add as preferred source on Google