Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

During one of the recent releases at work we ran into problems during performance testing of a new feature. This feature worked flawlessly in development and test environments but once hit with a heavy load, it started to manifest itself. Every now and then we'd get the following exception from the JDBC driver - ORA-01555: snapshot too old: rollback segment number with name "" too small.

Oracle Support already has a document that covers this error and the many different causes and solutions for it - Master Note for ORA-1555 Errors (Doc ID 1307334.1), however none of those seemed to have been the cause for the issue in our case.

This was the stack trace we were seeing...
 Exception
Caused by: java.io.IOException : ORA-01555: snapshot too old: rollback segment number with name "" too small
ORA-22924: snapshot too old
at oracle.jdbc.driver.OracleClobReader.needChars(OracleClobReader.java:252)
at oracle.jdbc.driver.OracleClobReader.read(OracleClobReader.java:192)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.read(BufferedReader.java:182)
...
Caused by: java.sql.SQLException : ORA-01555: snapshot too old: rollback segment number with name "" too small
ORA-22924: snapshot too old
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:441)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:436)
at oracle.jdbc.driver.T4C8TTILob.processError(T4C8TTILob.java:758)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
at oracle.jdbc.driver.T4C8TTIClob.read(T4C8TTIClob.java:249)
at oracle.jdbc.driver.T4CConnection.getChars(T4CConnection.java:3954)
at oracle.sql.CLOB.getChars(CLOB.java:448)
at oracle.jdbc.driver.OracleClobReader.needChars(OracleClobReader.java:235)
at oracle.jdbc.driver.OracleClobReader.read(OracleClobReader.java:192)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.read(BufferedReader.java:182)
...


So the issue had something to do with CLOBs. After much investigation and collaboration we received some advise about removing the cache option from the CLOB column on the table that we knew was causing this issue.

The cache option can be checked with the following query...
 SQL
SELECT cache, logging
FROM dba_lobs
WHERE table_name = 'your_table';


Originally this was set to YES in our case. To disable/remove the cache option, the following SQL was used...
 SQL
ALTER TABLE your_table
MODIFY LOB (your_clob_column) (NOCACHE LOGGING);


After this statement was executed the cache option was disabled. In our case this made all of the ORA-01555 errors disappear. If it doesn't help you, refer to the Oracle support note mentioned at the start of this post.

-i

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...