ORA-01555 — Причина ошибки — недостаточный размер сегмента отката.
Лечение:
Нужно обеспечить сохранность информации в UNDO на всё время пока выполняется запрос. Для этого нужно иметь достаточный размер параметра UNDO_RETENTION и достаточный размер табличного пространства UNDO.
Т.е. проще говоря, для того чтобы избежать возникновения ORA-01555 нужно увеличивать размер табличного пространства UNDO и параметр UNDO_RETENTION до тех пор пока операция не пройдет без ошибки.
Предварительная подготовка
1) Убедиться что UNDO управляется автоматически. Т.е. параметр БД UNDO_MANAGEMENT = AUTO.
Если не так, включить автоматическое управление (требуется перезапуск БД):
ALTER SYSTEM SET UNDO_MANAGEMENT=AUTO SCOPE=SPFILE;
После чего перезапустить БД.
2) Настройка табличного пространства UNDO
— Определить какого размера UNDO сейчас
SELECT SUM(a.bytes)/1024/1024 as "UNDO_SIZE_IN_MB"
FROM v$datafile a, v$tablespace b, dba_tablespaces c
WHERE c.contents = 'UNDO'
AND c.status = 'ONLINE'
AND c.tablespace_name = 'UNDO11' -- для RAC
AND b.name = c.tablespace_name
AND a.ts# = b.ts#;
— Табличное пространство UNDO состоит из одного файла???
— На диске где лежит файл табличного пространства UNDO еще есть свободное место??? Сколько его???
Здесь главное понять что файлы табличного пространства имеют достаточный размер (лучше сделать их авторасширяемыми) и их достаточное количество и на диске есть месть для авторасширения файлов.
3) Нужно определить наибольшее время выполнения SQL-запроса (т.е. время потраченное на выполнение самого долгого запроса). Для этого есть несколько способов. Если ни один из способов не выявил большого времени выполнения запроса, тогда придется экспериментальным путем устанавливать этот параметр. Можно сразу установить заведомо большое значение, но при этом нужно помнить что чем больше UNDO_RETENTION тем до большего размера может вырасти табличное пространство UNDO и это может закончиться переполнением диска, на котором находятся файлы UNDO.
3.1) Посмотрите alert.log на предмет наличия ошибки ORA-01555 в то время когда выполнялся экспорт. В сообщение об ошибке может быть указанно время в сек. Выполнения операции. Параметр UNDO_RETENTION нужно установить не менее чем это время, а лучше раза в два больше.
ORA-01555 caused by SQL statement below (SQL ID: 738wa64wpd5s2, Query Duration=224611 sec, SCN: 0x0a0e.44620301):
3.2) Если в alert.log ничего нет, то можно попробовать определить оптимальный начальный UNDO_RETENTION. Выполнять под SYS.
— Покажет колл. секунд выполнения самого долгого запроса за последние 7 дней
SELECT MAX(MAXQUERYLEN) FROM V$UNDOSTAT;
Параметр UNDO_RETENTION нужно установить большим чем полученное значение (можно сделать в два раза больше, чтобы иметь запас). После выполнения запроса, если он не выполняется регулярно, лучше вернуть UNDO_RETENTION исходное значение, чтобы табличное пространство UNDO не разрасталось.
4) Чтобы уменьшить вероятность возникновения ORA-01555 нужно чтобы с БД во время экспорта вообще никто не работал (потому что другие сессии могут также увеличивать UNDO). Идеально если экспорт будет выполняться вообще один. Нужно учесть что с БД могут работать не только пользователи, но и службы и пакетные задания (batcmd). Т.е. на время экспорта лучше остановить все службы, все задания и т.п.
Let’s see the error ORA-01555 UNDO_RETENTION first:
Description
ORA-01555: snapshot too old: rollback segment number string with name «string» too small
Cause
rollback records needed by a reader for consistent read are overwritten by other writers
Action
If in Automatic Undo Management mode, increase undo_retention setting. Otherwise, use larger rollback segments
Before we drill down to a deeper topic, we need to clarify some concepts:
- Undo space reclaimation
- Uncommitted active undo
- Committed expired undo
- Committed unexpired undo
- RETENTION GUARANTEE
- RETENTION NOGUARANTEE
- Rolled back undo
SMON will keep all undo as long as possible. It will do nothing about reclaimable candidates until the space is in pressure. When time comes, it will choose from the oldest to the nearest in order to reclaim.
In fact, lazy reclaimation is very popular algorithm on swiping unused but occupied resources. For example, we won’t clean the snow on the roof every time it falls until it looks too heavy.
It is never overwritten or cleaned even though the undo space is full. Once undo space is full with uncommitted undo, the later DML will fail.
In terms of UNDO_RETENTION, committed expired undo is an undo data which ages over the limit defined by UNDO_RETENTION. It’s a no-doubt candidate to be overwritten or cleaned.
It depends on whether guaranteed is enforced or not to determine the behavior.
The data is not a reclaimable candidate until expired, but you must declare GUARANTEE explicitly.
The data is a reclaimable candidate although it’s not expired. This is the default behavior of undo management without declaration.
It’s an expired undo which will become a reclaimable candidate once the rolling back is complete.
Raising the value of UNDO_RETENTION seems a good idea to solve the problem, but you may be disappointed in some conditions. You may check my post for more explanations: UNDO_RETENTION, How and Why
In this post, I will talk about ORA-01555 UNDO_RETENTION from two different perspectives to find the ways to reduce such error. You may judge the situation before actually doing it.
Solutions
The solutions depend on what condition that your database is able to provide.
When Resizing UNDO is Possible
UNDO_RETENTION is just an honored value to your queries in the default condition which is RETENTION NOGUARANTEE. Even more, undo space could be full before queries reach the time limit of UNDO_RETENTION and you will get ORA-01555 very early. Therefore, raising UNDO_RETENTION is useless, you need to enlarge the space if you can.
- Resize current datafile.
- Autoextend current datafile.
- Add a new datafile.
SQL> alter database datafile '/u01/oracle/rbdb1/undotbs01.dbf' resize 800m;
SQL> alter database datafile '/u01/oracle/rbdb1/undotbs01.dbf' autoextend on;
SQL> alter tablespace undotbs add datafile '/u01/oracle/rbdb1/undotbs02.dbf' autoextend on maxsize unlimited;
Further reading: How Big a Data File Can Be?
Now, the undo data will be kept as long as the space is enough for new transactions.
When Resizing UNDO is NOT Possible
If your UNDO tablespace cannot be resized or auto extended in this moment, then what you can do is very limited to none. My strategy is to compromise new transactions instead of queries so as to avoid ORA-01555. Which means, we raise and guarantee UNDO_RETENTION can be reached, no matter what.
- Raise UNDO_RETENTION whenever AUTOEXTEND is enabled.
- Enforce GUARANTEE on UNDO_RETENTION.
SQL> alter system set undo_retention = 14400 scope=both sid='*';
UNDO_RETENTION is kind a soft limit which is no guarantee. If the space is no longer extendable for new undo, the oldest committed undo will be sacrificed. So we have to make it GUARANTEE.
SQL> alter tablespace undotbs retention guarantee;
To reverse the setting, you can do this:
SQL> alter tablespace undotbs retention noguarantee;
The database will never touch unexpired undo with RETENTION GUARANTEE even if new DML transactions fail.
Therefore, a better practice is that you should ensure the undo space is enough to extend before enabling RETENTION GUARANTEE, otherwise, new DML transactions will fail due to a full undo.
More concepts can be found at Oracle website: Managing Undo
Just remember, keep your undo data in the UNDO tablespace as long as possible is the key to reduce ORA-01555.
Resolving The Problem
If you are running Oracle 9i or higher, you should be using an undo tablespace with automated undo management instead of a rollback tablespace. The use of an undo tablespace will prevent most of these errors.
ORA-01547 failed to allocate extent of size nnn in tablespace xxx
There is not enough room in the tablespaces file(s) to add an extent of nnnblocks.
Increase the size of the rollback tablespace by one of the following two methods. Both can be done
while users are active.
1. Add a datafile.
(a) Connect to ORACLE as SYSTEM via SQLPLUS and execute the following to see
the list of tablespaces and the files they own:
SELECT TABLESPACE_NAME,FILE_NAME FROM DBA_DATA_FILES
ORDER BY TABLESPACE_NAME,FILE_NAME;
(b) Add a datafile to the rollback tablespace (RBS on UNIX, ROLLBACK_DATA on NT or NLM).
Use the same path as the rollback tablespace files above, but a distinct filename. Use
a size of nnn megabytes for the new file.
ALTER TABLESPACE rollback_tablespace_name ADD DATAFILE
‘full_path_and_filename‘ SIZE nnnM;
2. Turn on AUTOEXTEND for one of the rollback datafiles (ORACLE 7.2.x or later only)
Connect to ORACLE as SYSTEM via SQLPLUS and execute the following to see
the list of tablespaces and the files they own:
SELECT TABLESPACE_NAME,FILE_NAME FROM DBA_DATA_FILES
ORDER BY TABLESPACE_NAME,FILE_NAME;
Turn on AUTOEXTEND and limit maximum size to nnn megabytes.
ALTER DATABASE DATAFILE ‘existing_rollback_file_path_and_name‘
AUTOEXTEND ON MAXSIZE nnnM;
ORA-01555 snapshot too old (rollback segment too small)
This generally occurs when a long running query shares a rollback segment with an
active UPDATE, INSERT, or DELETE. Instead of adding a new extent to the rollback
segment, ORACLE overwrites one of the extents used by the SELECT in the belief that
it has not been referenced recently enough to still be needed.
The usual fix for this is to recreate your rollback segments with more and/or larger
initial extents. You may also need to increase the size of the rollback tablespace
as per the ORA-01547 error above.
To recreate rollback segments, execute the following statements for each rollback
segment. The value for minextents should be large enough so that minextents times
initial is larger than the size of the table for which the SELECT error occurred.
Connect to ORACLE as SYSTEM via SQLPLUS and execute the following:
ALTER ROLLBACK SEGMENT name OFFLINE;
DROP ROLLBACK SEGMENT name;
CREATE ROLLBACK SEGMENT name TABLESPACE ts_name
STORAGE (INITIAL 1M NEXT 1M MINEXTENTS nn );
ALTER ROLLBACK SEGMENT name ONLINE;
If you have active users, you will find that in-use rollback segments will not go offline
immediately, but will go into a PENDING-OFFLINE state. You must then wait until
the segment goes offline to DROP and CREATE it. You can check on the status
by typing:
SELECT SEGMENT_NAME,STATUS FROM DBA_ROLLBACK_SEGS;
ORA-01556 maximum number of extents exceeded
The database attempted to allocate more than MAXEXTENTS to the rollback segment.
The default value of MAXEXTENTS is dependent on your operating system’s disk blocksize.
Usually 121 or 249 on unix and 121 on NT/Novell.
You should recreate your rollback segments with a larger INITIAL and NEXT value.
To check the current values, connect to ORACLE as SYSTEM via SQLPLUS
and execute the following:
SELECT SEGMENT_NAME,INITIAL_EXTENT,NEXT_EXTENT FROM
DBA_ROLLBACK_SEGS;
The sizes will be in bytes. Execute the ALTER/DROP/CREATE/ALTER sequence
as for the ORA-01555 error above to recreate the rollback segments with larger extents.
If you are running version 7.3 or higher, you can also increase the MAXEXTENTS value:
ALTER ROLLBACK SEGMENT name DEFAULT STORAGE
(MAXEXTENTS larger_value);
The above command must be repeated for each rollback segment.
ORA-01562 failed to extend rollback segment
This is normally followed by another error. Follow the procedure for the subsequent
error message. You may need to examine the database alert log to determine
the subsequent error.
The location of the alert log can be determined by running the following statement
from the ORACLE SYSTEM login:
SELECT VALUE FROM V$PARAMETER WHERE NAME
= ‘background_dump_dest’;
ORA-01552 cannot use system rollback segment for non-system tablespace …
Your public rollback segments are offline, or perhaps were never defined.
Check the status of your rollback segments by connecting to ORACLE as SYSTEM and
typing:
SELECT SEGMENT_NAME,STATUS FROM DBA_ROLLBACK_SEGS;
You will likely see that all except SYSTEM are OFFLINE. Put them online with the command:
ALTER ROLLBACK SEGMENT name ONLINE;
There is a good chance that you do not have a rollback_segments parameter in your
initxxx.ora file, or it has been commented out. You should have something like:
rollback_segments = (name1,name2,…,namen)
Listing each of your non-system rollback segments. This will cause them to be brought
online automatically at each startup (instead of having to use ALTER commands).
If the SELECT statement above shows NO rollback segments other than system, you will
need to create them (see commands for error ORA-01555 above) and also add the
rollback_segments parameter to your initxxx.ora file.
[{«Product»:{«code»:»SSLKT6″,»label»:»IBM Maximo Asset Management»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Not Applicable»,»Platform»:[{«code»:»PF025″,»label»:»Platform Independent»}],»Version»:»4.1.1;5.1;5.2;6.0;6.1;6.2;6.2.1;6.2.2;6.2.3;6.2.4;6.2.5;6.2.6;6.2.7;6.2.8″,»Edition»:»All Editions»,»Line of Business»:{«code»:»LOB59″,»label»:»Sustainability Software»}}]
Any idea about
ORA-1555: snapshot too old: rollback segment number
I am getting this error and nothing seems to be wrong. Please state under what conditions in may occur and how it can be avoided?
asked Nov 6, 2009 at 9:58
Sachin ChourasiyaSachin Chourasiya
20.3k32 gold badges85 silver badges98 bronze badges
4
Frequent commits can be the cause of ORA-1555.
It’s all about read consistency. The time you start a query oracle records a before image. So the result of your query is not altered by DML that takes place in the mean time (your big transaction). The before image uses the rollback segments to get the values of data that is changed after the before image is taken.
By committing in your big transaction you tell oracle the rollback data of that transaction can be overwritten.
If your query need data from the rollback segments that is overwritten you get this error. The less you commit the less chance you have that the rollback data you need is overwritten.
One common cause of ORA-1555 is a procedure that does this all in itself : a cursor on a table, loop through the records, and updates/delete the same table and commits every x records.
As guigui told : let the rollback segments grow to contain your whole transaction
answered Nov 6, 2009 at 15:22
I suggest you read Tom’s answer :
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1441804355350
«The ORA-1555 happens when people try to save space typically. They’ll have small
rollback segments that could grow if they needed (and will shrink using OPTIMAL). So,
they’ll start with say 10 or so 1meg rollback segments. These rollback segments COULD
grow to 100meg each if we let them (in this example) however, they will NEVER grow unless
you get a big transaction.
«
answered Nov 6, 2009 at 10:03
2
Typically this occurs when code commits inside a cursor.
eg.
for x in (select ... from ...)
loop
do something
commit;
end loop;
See the AskTom link form guigui42 though for other examples.
answered Nov 6, 2009 at 11:45
David AldridgeDavid Aldridge
51k8 gold badges69 silver badges95 bronze badges
3
Any idea about
ORA-1555: snapshot too old: rollback segment number
I am getting this error and nothing seems to be wrong. Please state under what conditions in may occur and how it can be avoided?
asked Nov 6, 2009 at 9:58
Sachin ChourasiyaSachin Chourasiya
20.3k32 gold badges85 silver badges98 bronze badges
4
Frequent commits can be the cause of ORA-1555.
It’s all about read consistency. The time you start a query oracle records a before image. So the result of your query is not altered by DML that takes place in the mean time (your big transaction). The before image uses the rollback segments to get the values of data that is changed after the before image is taken.
By committing in your big transaction you tell oracle the rollback data of that transaction can be overwritten.
If your query need data from the rollback segments that is overwritten you get this error. The less you commit the less chance you have that the rollback data you need is overwritten.
One common cause of ORA-1555 is a procedure that does this all in itself : a cursor on a table, loop through the records, and updates/delete the same table and commits every x records.
As guigui told : let the rollback segments grow to contain your whole transaction
answered Nov 6, 2009 at 15:22
I suggest you read Tom’s answer :
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1441804355350
«The ORA-1555 happens when people try to save space typically. They’ll have small
rollback segments that could grow if they needed (and will shrink using OPTIMAL). So,
they’ll start with say 10 or so 1meg rollback segments. These rollback segments COULD
grow to 100meg each if we let them (in this example) however, they will NEVER grow unless
you get a big transaction.
«
answered Nov 6, 2009 at 10:03
2
Typically this occurs when code commits inside a cursor.
eg.
for x in (select ... from ...)
loop
do something
commit;
end loop;
See the AskTom link form guigui42 though for other examples.
answered Nov 6, 2009 at 11:45
David AldridgeDavid Aldridge
51k8 gold badges69 silver badges95 bronze badges
3
There are many reasons for this error. In this post I am providing all the possible scenarios and related Oracle Notes/Links.
Concepts/Definitions
The ORA-1555 errors can happen when a query is unable to access enough undo to build
a copy of the data at the time the query started. Committed «versions» of blocks are
maintained along with newer uncommitted «versions» of those blocks so that queries can
access data as it existed in the database at the time of the query. These are referred to as
«consistent read» blocks and are maintained using Oracle undo management.
See Document 40689.1 — ORA-1555 «Snapshot too old» — Detailed Explanation for more about
these errors.
Diagnosing
Due to space limitations, it is not always feasible to keep undo blocks on hand for the life of the instance. Oracle Automatic Undo Management (AUM) helps to manage the time frame that undo blocks are stored. The time frame is the «retention» time for those blocks.
There are several ways to investigate the ORA-1555 error. In most cases, the error is a legitimate problem with getting to an undo block that has been overwritten due to the undo «retention» period having passed.
AUM will automatically tune up and down the «retention period, but often space limitations or configuration of the undo tablespace will throttle back continuous increases to the «retention» period.
The error message is reported in the user session and often is not captured in the alert log. The user could see a message like
Using rollback segment functionality:
ORA-1555: snapshot too old (rollback segment too small)
or
Using AUM:
ORA-01555: snapshot too old: rollback segment number 9 with name «_SYSSMU9$» too small
If the error is captured in the alert.log, you would see something like
Tue May 26 16:16:57 2009
ORA-01555 caused by SQL statement below (SQL ID: 54yn3n36w24ft, Query Duration=922 sec, SCN: 0x0007.8a55f4e3)
Rollback Segments:
With Oracle 10g and later versions of Oracle, you can still use a Rollback Segments configuration. ORA-1555 errors in that environment still follow older guidelines as described in
Document 10579.1 — How many Rollback Segments to Have
Document 107085.1 — Tuning Rollback Segments
Document 69464.1 — Rollback Segment Configuration & Tips
Automatic Undo Management:
The database will be self tuning for undo when using Automatic Undo Management. This does not eliminate ORA-1555 completely, but does minimize ORA-1555 as long as there is adequate space in the undo tablespace and workloads tend to follow repeatable patterns. In some cases with periodic changes to workload (large data updates particularly with LOB data) the self tuning of undo can become aggressive and lead to undo issues.
Document 461480.1 — FAQ Automatic Undo Management (AUM) / System Managed Undo (SMU)
Document 135053.1 — How to Create a Database with Automatic Undo Management
Document 268870.1 — How to Shrink the datafile of Undo Tablespace
Document 231776.1 — How to switch a Database from Automatic Undo Management (AUM) back to using Rollback Segments
Document 396863.1 — How to Keep All UNDO Segments from Being Offlined in Oracle 10g — Fast Ramp-Up
LOB Issues:
Out-of-row LOB undo is maintained in the LOB segment. So the UNDO tablespace and undo retention is not associated with most LOB ORA-1555 issues. Instead the LOB column is created using either PCT_VERSION or RETENTION to manage how much space within blocks or time transpires before the LOB undo is overwritten. In environments with high updates, deletes on rows including LOBs, the chances of ORA-1555 on LOB undo is very high.
PCT_VERSION and RETENTION are not auto-tuned. To «tune» those configuration settings, you must change the values for PCT_VERSION or RETENTION. Changes to UNDO_RETENTION does not change LOB retention time frames.
Document 162345.1 — LOBS — Storage, Read-consistency and Rollback
Document 386341.1 — How to determine the actual size of the LOB segments and how to free the deleted/unused space above/below the HWM
Document 563470.1 ‘Lob retention not changing when undo_retention is changed
Document 422826.1 How to identify LOB Segment Use PCTVERSION or RETENTION from Data Dictionary
Error Tracing
Undo error tracing can be done for normal undo operations using the following events:
NOTE: Normal undo operations will be indicated in the error message in that the error message includes a segment name like
‘¦. name «_SYSSMU1$» too small
If the error doesn’t show a segment name
‘¦ name «» too small
the problem is often related to LOB undo
If using pfile:
event=»10442 trace name context forever, level 10″
If using spfile:
Alter system set events ‘10442 trace name context forever, level 10’;
Reproduce the ORA-1555 error and upload the trace file to Oracle Support.
LOB undo error tracing is more difficult. Set additional tracing events as follows:
Start Session 1
Alter session set events ‘10046 trace name context forever, level 12’;
Reproduce the error
Exit Session 1
Start Session 2
Alter session set events ‘10051 trace name context forever, level 1’;
Reproduce the error
Exit Session 2
Start Session
Alter session set events ‘1555 trace name errorstack forever, level 3’;
Reproduce the error
Exit Session 3
Additional resources to review:
Document 846079.1 — LOBs and ORA-1555 troubleshooting
Document 253131.1 — Concurrent Writes May Corrupt LOB Segment When Using Auto Segment Space Management
Document 467872.1 — TROUBLESHOOTING GUIDE (TSG) — ORA-1555
V$UNDOSTAT Analysis
The V$UNDOSTAT view holds undo statistics for 10 minute intervals. This view
represents statistics across instances, thus each begin time, end time, and
statistics value will be a unique interval per instance.
This does not track undo related to LOB
Document 262066.1 — How To Size UNDO Tablespace For Automatic Undo Management
Document 1112363.1 — When Does Undo Used Space Become Available?
Document 240746.1 — 10g NEW FEATURE on AUTOMATIC UNDO RETENTION
Diagnostics Scripts
Refer to Document 746173.1 : Common Diagnostic Scripts for AUM problems
and Document 877613.1 : AUM Common Analysis/Diagnostic Scripts
Common Causes/Solutions
Document 1555.1 — Known defects for ora-1555 error
Using Rollback Segments functionality:
* Problem happening on SYSTEM tablespace that still uses old Rollback Segment functionality even when configured for Automatic Undo Management (AUM).
* There are not enough rollback segments to manage the undo needed for long running queries.
* Rollback Segments are too small and undo is overwritten before long running queries complete.
Reference:
Document 69464.1 — Rollback Segment Configuration & Tips
Document 10630.1 — ORA-1555: ‘Snapshot too old’ — Overview
Document 862469.1 — ORA-604 & ORA-1555 Rollback Segment 0 with Name «System» Too Small
Using Automatic Undo Management (AUM):
* TUNED_UNDORETENTION in V$UNDOSTAT around the time of the error is lower than the QUERY DURATION indicated in the error message. This is a legitimate ORA-1555 and if queries are going to run for very long time frames, UNDO_RETENTION may need to be larger. Auto-tuned retention may not be able to keep up with the undo workload and staying within space limitations on the UNDO tablespace.
* LOB updates and/or deletes are frequent and a higher PCT_VERSION is required to provide enough space in the LOB Segment to accommodate the LOB undo. RETENTION on LOBs that are updated or deleted frequently can run into problems holding UNDO long enough for queries.
* QUERY DURATION shown in the error message is 30+ years and therefore, no amount of undo will satisfy the consistent read blocks.
Document 750195.1 — ORA-1555 Shows Unrealistic Query Duration (billions of seconds)
* QUERY DURATION shown in the error message is 0. NOTE: This has been filed as a bug on many release levels and has been very difficult to narrow down to a specific problem.
Document 761128.1 — ORA-1555 Error when Query Duration as 0 Seconds
* QUERY DURATION is lower than TUNED_UNDRETENTION. Undo header information can sometimes get overwritten or you could be seeing a bug.
* TUNED_UNDORETENTION stays very high and UNDO tablepsace continues to grow continuously or getting space errors.
Document 1112431.1 — Undo Remains Unexpired When Using Non-autoextensible Datafiles for Undo Tablespace.
* How to find the complete SQL statement caused ORA-1555 :
If the Database was not restarted after the error ORA-1555 , so the Statement can be obtained from :
select SQL_TEXT from SQL_TEXT where SQL_ID='<sql id from the error message>’;
If the Database was restarted after the error ORA-1555 and an AWR snapshot was gathered before the restart , so the Statement can be obtained from :
select SQL_TEXT from DBA_HIST_SQLTEXT where SQL_ID='<sql id from the error message>’;
Thanks
Satishbabu Gunukula, Oracle ACE
http://oracleracexpert.com
ORA-01555: snapshot too old: rollback segment number with name «» too small
When I calling procedure after that I am writing commit.
Actually, I want to copy the data from one table to a temporary table.
but data is not inserting and giving ORA-01555: snapshot too old: rollback segment number with name «» too small Error.
please give me a solution.
asked Jun 20, 2011 at 6:59
1
The easiest way to copy data from one table to another is to create the new table like this:
create table table2 as select * from table1;
answered Jun 20, 2011 at 11:12
Tony AndrewsTony Andrews
129k21 gold badges221 silver badges258 bronze badges
0
You get «ORA-01555: snapshot too old: rollback segment number with name» usually when the SQL runs too long. This is because rollback records needed by a reader for consistent read are overwritten by other writers. It would be helpful if you share your code snippet.
answered Jan 29, 2013 at 23:23
ORA-01555: snapshot too old: rollback segment number 9 with name «SYSSMU 9*
Solution :
Step :1) check size of undo_retention parameter .
if it is 900. increase to 3600 by doing step 3.
Step 2 : SQL> show parameter undo_retention;
NAME TYPE VALUE
undo_retention integer 900
Step 3 :SQL> ALTER SYSTEM SET UNDO_RETENTION = 3600;
System altered.
Increase Undo Table space to Auto Extended on.
then try again.
How long does it take from the beginning of the operation to the point when the Oracle error occurs? In situations that I’ve seen it the time could be measured in hours and it was a good indication that the work should have been cut up in chunks with commits after every chunk. If that time is short, you might be just running out of the disk space or have your Oracle instance misconfigured.
answered Jun 21, 2011 at 15:50
OlafOlaf
6,2031 gold badge18 silver badges37 bronze badges