ORA-01555: snapshot too old的分析與解決
應用程式拋瞭如下的異常:
SQL> exec PR_COMPARE_FREEZEBALANCE_TEMP();
begin PR_COMPARE_FREEZEBALANCE_TEMP(); end;
ORA-01555: snapshot too old: rollback segment number 10 with name "_SYSSMU10$" too small
ORA-06512: at "MOCSACCT.PR_COMPARE_FREEZEBALANCE_TEMP", line 16
ORA-06512: at line 1
在告警日誌中發現如下的異常:
[@more@]Wed Mar 12 20:09:22 2008
ORA-01555 caused by SQL statement below (Query Duration=11325 sec, SCN: 0x000d.7a79d7d1):
Wed Mar 12 20:09:22 2008
SELECT B.ACCTID,NVL(B.FREEZEBALANCE,0) FROM T_ACCTBOOK B
Wed Mar 12 20:09:23 2008
查詢undo的相關資料庫引數,如下:
SQL> show parameter undo
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 10800
undo_suppress_errors boolean TRUE
undo_tablespace string UNDOTBS1
SQL>
SQL> select sum(bytes/1024/1024/1024) from dba_data_files where tablespace_name='UNDOTBS1';
SUM(BYTES/1024/1024/1024)
-------------------------
15.9980469
SQL>
對異常ORA-01555的解釋如下:
ORA-01555 snapshot too old: rollback segment number string with name "string" too small
Cause: Rollback records needed by a reader for consistent read are overwritten by other writers.
Action: If in Automatic Undo Management mode, increase the setting of UNDO_RETENTION. Otherwise, use larger rollback segments.
對異常ORA-01555的深入解釋如下:
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、應用程式儘量避免巨表的漫長查詢操作,改傳統的cursor遊標為bulk collect;
2、儘量程式中不要使用大事務量的增刪改操作,同時記得及時commit;
3、加大undo表空間和加大undo的retention。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/38542/viewspace-1000873/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-01555: snapshot too old: rollback segment number with name "" too small
- 【效能優化】處理ORA-01555:Snapshot Too Old優化
- 0225Snapshot Too Old Error ora-01555.txtError
- exp匯出blob資料時報 ORA-22924: snapshot too old
- svn This client is too old to work with working copy錯誤解決方案client
- 關於如何解決解決The SDK platform-tools version ((25.0.3)) is too old to check APIs compiled with API 26PlatformAPICompile
- 解決 'PLAN_TABLE' is old version
- 解決 Too many symbol filesSymbol
- ORA-01555故障解決案例
- ORA-01555 解決處理方案
- MongoDB chunk too big to move的解決方案MongoDB
- Mysql中too many connections問題的解決MySql
- Ubuntu 解決 Too many open files 問題Ubuntu
- -bash: /bin/rm: Argument list too long的解決辦法
- Android Studio錯誤處理Plugin is too old, please update to a more recent versionAndroidPlugin
- nodejs Error: request entity too large解決方案NodeJSError
- Ora-01555問題分析
- ORA-01555錯誤分析
- oracle 9i下ORA-01555錯誤的解決方法Oracle
- Java程式碼解決ElasticSearch的Result window is too large問題JavaElasticsearch
- 關於ORA-01555的問題分析
- Mysql 報Row size too large 65535解決方法MySql
- Row size too large (> 8126)解決辦法
- 解決Mysql錯誤[1040]Too many connectionsMySql
- 解決WebLogic中Too many open files異常Web
- gunzip時,提示file too large(問題已解決)
- File name too long window和linux排查,解決Linux
- ORA-01555 問題分析(轉)
- MySQL死鎖分析與解決之路MySql
- 解決 Specified key was too long ... 767 bytes 的本質問題
- 啟動Amoeba報The stack size specified is too small解決方法
- 刪除大量檔案Argument list too long錯誤解決
- 解決:ChatGPT too many requests in 1 hour.Try again laterChatGPTAI
- Nginx出現413 Request Entity Too Large錯誤解決方法Nginx
- SAP:CX_SY_READ_SRC_LINE_TOO_LONG解決
- WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!的分析AIENQ
- ORA-01555錯誤詳解
- ORA-01207: old control file完全解決方案