# ORA-01555：快照过旧：回滚段号 名称为“_SYSSMU11_1234567890$”太小

- **ID:** `database/read-committed-snapshot-too-old`
- **领域:** database
- **类别:** runtime_error
- **错误码:** `ORA-01555`
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

Oracle回滚段包含需要的一致性读取数据，但由于长时间运行的查询或撤销保留不足而被覆盖。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Oracle 19c | active | — | — |
| Oracle 21c | active | — | — |
| Oracle 23ai | active | — | — |

## 解决方案

1. ```
   Increase the undo tablespace size: ALTER TABLESPACE undo ADD DATAFILE '/u01/oradata/undo02.dbf' SIZE 10G;
   ```
2. ```
   Optimize the query to fetch data in smaller batches or use COMMIT more frequently: BEGIN FOR rec IN (SELECT * FROM huge_table WHERE ...) LOOP ... END LOOP; END;
   ```
3. ```
   Set undo_retention guarantee: ALTER TABLESPACE undo RETENTION GUARANTEE;
   ```

## 无效尝试

- **Increase UNDO_RETENTION to a very high value like 86400 seconds** — Undo retention is only a target, not a guarantee; Oracle may still overwrite undo if tablespace is full or if undo tablespace is undersized. (70% 失败率)
- **Set undo_management='MANUAL' to use manual rollback segments** — Manual rollback segments are deprecated and can lead to worse ORA-01555 errors due to fixed segment sizes and no auto-tuning. (90% 失败率)
