ORA-1555: snapshot too old (rollback segment too small)

The usual cause of this error is that long-running transactions/queries are occurring within the database at the same time as short online transactions. When the short transactions complete, the rollback segments they have used is up for grabs and can be overwritten. As soon as that area is overwritten, the long-running queries/transactions can no longer maintain a read consistent picture of the data, and they fail with an ORA-1555. It's a scheduling problem. Run batch and long-running jobs at off-hours.

Example Scenario:
1.A long running Query (T1) is started.
2.A quick update (T2) is performed and committed on a table that T1 won't require for another 20 minutes. When T2 is committed it's rollback segment blocks and extents are kept but marked as inactive.
3.Another DML statement is issued (T3). Oracle assigns a rollback segment to T3 using a round robin algorithm. The assigned segment includes the same storage as the one previously used by T2. Thus it overwrites the inactive before-image of T2.
4.T1 now comes to the point in the query where it needs the before-image of the data that was changed by T2.
5.But T1 must read the before-image of the changed data records (for read consistency).
6.T1 attempts to read the before-image left from T2 -- only to find that it has been overwritten by T3.
7.T1 can no longer access the before-image of T2. T1 abends at this point.
8.ORACLE then issues: ORA-1555: snapshot too old (rollback segment too small).

可以采取的措施有:

1、应用程序尽量避免巨表的漫长查询操作

2、尽量程序中不要使用大事务量的增删改操作,同时记得及时commit

3、加大undo表空间和加大undoretention

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值