ORA-01555 和游标

简介:   This is the situation when a query opens a cursor, then loops through fetching, changing, and committing the records on the same table.
 
This is the situation when a query opens a cursor, then loops through fetching, changing, and committing the records on the same table. In this scenerio, very often an ORA-01555 can result. Let's take the  following example to explain this:

A cursor was opened at SCN=10. The execution SCN of the query is  then marked as SCN=10. Every fetch by that cursor now needs to get the read-consistent data from SCN=10. The user program is now  fetching x numbers of records, changing them, and committing them. Let's say they were committed with SCN=20. If a later fetch happens to retrieve a record which is in one of the previously committed  blocks, then the fetch will see that the SCN there as 20. Since the fetch has to get the snapshot from SCN=10 it will try to find it in the rollback segments. If it could rollback sufficiently backwards  as previously explained, then it could reconstruct the snapshot  from SCN=10. If not, then it will result in an ORA-01555 error.

目录
打赏
0
0
0
0
91
分享
相关文章
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等