Home>Question Details



Ummar -- Thanks for the question regarding "Please sujjest how to avoid Frequent snapshot too old error", version 9.2.0.6.0

Submitted on 13-Jun-2007 3:36 Central time zone
Last updated 14-Jun-2007 7:18

You Asked

Hi,

We are getting the Snapshot too old error very frequently in one of our Production instances. Since every time we increase the undo_retention. can you sujjest any permanant solution for the resolution of this error.

Thanks and Regards
Ummar

and we said...

You must

a) set your undo_retention to an interval that is longer than your longest running query

Maxquerylen in v$undostat can help you there.

b) ensure you have sufficient undo tablespace space - against, v$undostat will be crucial there, you can measure the amount of undo you generate in a given period of time - so as to determine how much space you need to allocate.
Reviews    
2 stars Sujjest the best possible solution   June 14, 2007 - 2am Central time zone
Reviewer: Ummar Mir from INDIA
Hi,

I have checked it before as wel, since the longest running query goes beyond 20000, and our undo can support this as wel, but the only concern here is that if we increace the retention more than this what will be the impact on the other smaller running queries?

Thanks and Regards
Ummar



Followup   June 14, 2007 - 7am Central time zone:

... what will be the impact on the other smaller running queries? ...

they will continue to operate as before.
3 stars Do not commit accross fetch   June 14, 2007 - 2am Central time zone
Reviewer: Mohamed Houri from FRANCE
In order to help you avoiding snapshot too old error

1. Do not commit accross fetch
LOOP
....
COMMIT; -- if you have a commit here than remove it
-- and do it outside the loop
END LOOP;

2. Ensure (if possible) that you (or other sessions)
are not updating data you have selected in the
begining of your process

3. You can also put the content of your main query into
a plsql table, close you cursor and loop on the plsql
table instead of looping on your cursor

4. make your system restartable so that even if you
encounter the ora-01555 you can restart your process
from the point where it fails.




All information and materials provided here are provided "as-is"; Oracle disclaims all express and implied warranties, including, the implied warranties of merchantability or fitness for a particular use. Oracle shall not be liable for any damages, including, direct, indirect, incidental, special or consequential damages for loss of profits, revenue, data or data use, incurred by you or any third party in connection with the use of this information or these materials.

About Oracle | Legal Notices and Terms of Use | Privacy Statement