ORA-01555 Snapshot too old

ORA-01555 is caused by Oracle read consistency mechanism.
When you run a select all data refer to the same “Instant”, from the first to the last selected row, for the entire duration of the processing and for how many changes are made on the selected tables from other transaction.
When read consistency is not more possibile, the error appear.
To solve “ORA-01555” you need to set the parameter of undo_retention and stretch retention.
The informations of UNDO is stored in Rollback Segments until the commit or rollback, then these segments are available to be overwritten. The automatic management of UNDO allows you to specify how long the info may be held before the commit preventing the error “snapshot too old” changing parameter UNDO_RETENTION
UNDO_RETENTION specifies (in seconds) the low threshold value of undo retention.
The UNDO_RETENTION parameter can only be changed if the current undo tablespace has enough space. If an active transaction requires undo space and the undo tablespace does not have available space, then the system starts reusing unexpired undo space. This action can potentially cause some queries to fail with a “snapshot too old” message.
The following example illustrates the stretch of the UNDO_RETENTION
SQL> alter system set UNDO_RETENTION=9000 scope=both;
System altered.
SQL> show parameter undo
NAME TYPE VALUE
———————————— ———– ——————————
_in_memory_undo boolean FALSE
_undo_autotune boolean FALSE
undo_management string AUTO
undo_retention integer 9000
undo_tablespace string UNDOTBS1

You may also like...

Leave a Reply

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