oracle ORA-1555: 快照太旧:回滚段号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1686564/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 02:12:27  来源:igfitidea点击:

ORA-1555: snapshot too old: rollback segment number

oracle

提问by Sachin Chourasiya

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?

关于 ORA-1555 的任何想法:快照太旧:回滚段号 我收到此错误,似乎没有任何问题。请说明在什么情况下可能发生以及如何避免?

采纳答案by guigui42

I suggest you read Tom's answer : http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1441804355350

我建议你阅读汤姆的回答: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.
"

“ORA-1555 通常发生在人们试图节省空间时。他们会有小的回滚段,如果需要,可以增长(并且会使用 OPTIMAL 缩小)。因此,他们将从 10 个左右的 1meg 回滚段开始。如果我们允许它们(在本例中),这些回滚段每个可以增长到 100meg,但是,除非您获得大事务,否则它们永远不会增长。

回答by Rob van Laarhoven

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.

频繁提交可能是 ORA-1555 的原因。这完全是关于读取一致性。您开始查询 oracle 的时间记录了一个 before 映像。因此,您的查询结果不会被同时发生的 DML 更改(您的大事务)。前图像使用回滚段来获取拍摄前图像后更改的数据值。通过在你的大事务中提交,你告诉 oracle 该事务的回滚数据可以被覆盖。如果您的查询需要来自被覆盖的回滚段的数据,则会出现此错误。您提交的越少,您需要的回滚数据被覆盖的机会就越少。

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.

ORA-1555 的一个常见原因是一个过程本身就完成了这一切:表上的游标,遍历记录,更新/删除同一个表并提交每 x 条记录。

As guigui told : let the rollback segments grow to contain your whole transaction

正如 guigui 所说:让回滚段增长以包含您的整个事务

回答by David Aldridge

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.

有关其他示例,请参阅来自 guigui42 的 AskTom 链接。