等待事件wait for a undo record 與 fast_start_parallel_rollback引數
今天一個客戶報資料庫執行速度很慢,登上去查。
檢查資料庫,發現資料庫中存在很多wait for a undo record等待事件。再檢查發現有很多的併發程式在執行。
通常,如果有很多併發程式,可以根據v$px_session檢視去檢視,檢視v$px_session檢視,發現所有的併發程式都是由smon程式導致(即qcsid列為smon程式的session id)
而smon程式的等待事件為wait for stopper event to be increased
關於這個現象,查詢mos,可以看到相應的解釋和解決方法(464246.1)
In fast-start parallel rollback, the background process SMON acts as a coordinator and rolls back a set of transactions in parallel using multiple server processes.
Fast start parallel rollback is mainly useful when a system has transactions that run a long time before a commit, especially parallel Inserts, Updates, Deletes operations. When SMON discovers that the amount of recovery work is above a certain threshold, it automatically begins parallel rollback by dispersing the work among several parallel processes.
There are cases where parallel transaction recovery is not as fast as serial transaction recovery because the PQ slaves may interfere with each others work by contending for the same resource. With such a transaction rollback performance may be worse in parallel when compared to a serial rollback.
Becasue of this contention and the perceived slowness and 'hang' like symptoms (the database may seem to hang, SMON and parallel query slaves may be seen to take all the available CPU), DBA intervent
即smon程式在做大事務的回滾,預設引數fast_start_parallel_rollback引數為low,即回滾時會啟動2*CPU個數 個併發程式。而由於是使用併發,所以可能由於併發之間相互使用共同的資源,導致回滾速度更慢。
解決方法為將fast_start_parallel_rollback引數改為false
fast_start_paralllel_rollback引數是可以動態修改的,但是對於正在執行大量的回滾操作的資料庫例項來說,可能動態修改會導致一些問題(具體會是什麼問題,oracle官方文件並沒有說),正確修改方法參考官方文件(238507.1)
1.查詢smon程式ID
2.禁用smon程式的事務清理(Disable SMON transaction cleanup)
oradebug setorapid 'SMON's Oracle PID';
oradebug event 10513 trace name context forever, level 2
3.查詢V$FAST_START_SERVERS檢視,將所有smon啟用的併發程式殺掉
4.修改fast_start_parallel_rollback引數
alter system set fast_start_parallel_rollback=false;
5.啟用smon程式的事務清理(enable transaction recovery)
oradebug setorapid 'SMON's Oracle PID';
oradebug event 10513 trace name context off
關於fast_start_paralllel_rollback引數的介紹:
FALSE indicates that parallel rollback is disabled 禁用併發回滾(注意是禁用併發回滾,不是禁用回滾。只是回滾的時候不使用併發)
LOW limits the number of rollback processes to 2 * CPU_COUNT 預設值
HIGH limits the number of rollback processes to 4 * CPU_COUNT
對於資料庫中的回滾事務,可以檢視下面的檢視監控:
V$FAST_START_SERVERS
V$FAST_START_TRANSACTIONS
分別檢視回滾的程式資訊和事務資訊
select pid from v$fast_start_servers where state='RECOVERING';
select spid from v$process where pid in (select pid from v$fast_start_servers where state='RECOVERING');
select * from v$fast_start_transactions;
Database Appears to Hang Waits for "Wait for a undo record" and "Wait for stopper event to be increased" Due to Parallel Transaction Recover (文件 ID 464246.1)
How to Disable Parallel Transaction Recovery When Parallel Txn Recovery is Active (文件 ID 238507.1)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2565262/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20130904]等待事件wait for a undo record.txt事件AI
- [20130904]等待事件wait for a undo record模擬.txt事件AI
- 啟動資料庫後,等待事件出現大量wait for undo record資料庫事件AI
- Oracle常見UNDO等待事件Oracle事件
- ARCH wait on SENDREQ 等待事件AI事件
- virtual circuit wait等待事件UIAI事件
- oracle wait event 等待事件OracleAI事件
- 等待事件ARCH wait on ATTACH事件AI
- 等待事件 (wait event) [final]事件AI
- oracle virtual circuit wait 等待事件OracleUIAI事件
- 引數FAST_START_PARALLEL_ROLLBACKASTParallel
- buffer busy wait 等待事件說明AI事件
- cursor: pin S wait on X等待事件。AI事件
- log buffer space wait event等待事件AI事件
- 引數FAST_START_PARALLEL_ROLLBACK(ZT)ASTParallel
- 模擬產生CBC LATCH與buffer busy wait等待事件AI事件
- [異常等待事件latch undo global data]分析事件
- buffer busy wait 等待事件說明(轉)AI事件
- 【WAIT】 log file sync等待事件說明AI事件
- ORACLE等待事件型別【Classes of Wait Events】Oracle事件型別AI
- 關於fast_start_parallel_rollback引數ASTParallel
- Oracle UNDO引數Oracle
- oracle等待事件之cursor:pin S wait on XOracle事件AI
- 常見的wait等待事件及處理AI事件
- cursor: pin S wait on X等待事件模擬AI事件
- 常見的wait等待事件及處理(zt)AI事件
- oracle等待事件型別wait_class說明Oracle事件型別AI
- 等待事件:wait for unread message on broadcast channel事件AIAST
- Oracle資料庫buffer busy wait等待事件 (2)Oracle資料庫AI事件
- Oracle資料庫buffer busy wait等待事件 (1)Oracle資料庫AI事件
- cursor: pin S wait on X等待事件模擬(轉)AI事件
- zt_eygle大師_如何與io相關的wait event等待事件AI事件
- Oracle UNDO引數詳解Oracle
- 【故障】cursor: pin S wait on X等待事件大量出現AI事件
- db file sequential read wait event等待事件之二AI事件
- oracle等待引數含義_v$session_wait_p1_p2_p3OracleSessionAI
- table和record 型別用作引數型別
- fast_start_parallel_rollback引數的一點測試ASTParallel