One of the most frustrating errors DBAs face in Oracle 19c is ORA-01555: snapshot too old. Here’s a practical fix.
Cause
Undo retention is too low or undo tablespace is undersized for long-running queries.
Solution
-- Check current settings
SHOW PARAMETER undo_retention;
SELECT tablespace_name, size_in_gb FROM (
SELECT tablespace_name, ROUND(SUM(bytes)/1024/1024/1024,2) size_in_gb
FROM dba_data_files GROUP BY tablespace_name);
-- Fix
ALTER SYSTEM SET undo_retention=7200 SCOPE=BOTH; -- 2 hours
-- Resize undo tablespace
ALTER TABLESPACE UNDOTBS1 RESIZE 10G;
Pro Tip (Developer): Use /*+ RESULT_CACHE */ or smaller batch processing in long queries.