How to avoid ORA-01555 “snapshot too
From the developer’s
Restructure your PL/SQL code to
avoid fetching across commits that cause the ORA-01555 error.
One possible reason can be if we
leave the cursor open for fetching while
we are processing and committing data changes for a long time.