等待事件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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle常見UNDO等待事件Oracle事件
- buffer busy wait 等待事件說明(轉)AI事件
- 【WAIT】 log file sync等待事件說明AI事件
- [異常等待事件latch undo global data]分析事件
- oracle等待事件之cursor:pin S wait on XOracle事件AI
- 常見的wait等待事件及處理(zt)AI事件
- 28、undo_1_2(undo引數、undo段、事務)
- Oracle10g等待事件型別wait_class說明Oracle事件型別AI
- openGauss/MOGDB與PG等待事件事件
- Cursor Mutex S Waits等待事件引發hangMutexAI事件
- 引數fast_start_parallel_rollback調整oracle回滾的速度ASTParallelOracle
- 同步篇——事件等待與喚醒事件
- Solidity事件,等待事件Solid事件
- 2.6.8.2 UNDO_TABLESPACE 初始化引數
- 2.6.8.1 UNDO_MANAGEMENT 初始化引數
- 【TUNE_ORACLE】等待事件之等待事件類別Oracle事件
- Lock wait timeout exceeded; try restarting transaction引數控制AIREST
- Selenium等待事件Waits事件AI
- MySQL之wait_timeout和interactive_timeout引數MySqlAI
- React事件傳遞引數React事件
- Oracle undo保留時間的幾個相關引數Oracle
- read by other session等待事件Session事件
- log file sync等待事件事件
- ORACLE 常見等待事件Oracle事件
- latch等待事件彙總事件
- Latch free等待事件(轉)事件
- gc cr request等待事件GC事件
- 【等待事件】library cache pin事件
- 【等待事件】log file sync事件
- vue事件帶預設引數,怎麼傳遞其他引數Vue事件
- 【TUNE_ORACLE】等待事件之日誌等待“log file sync”Oracle事件
- 【TUNE_ORACLE】等待事件之IO等待“read by other session”Oracle事件Session
- 【TUNE_ORACLE】等待事件之IO等待“direct path read”Oracle事件
- 【TUNE_ORACLE】等待事件之IO等待“direct path write”Oracle事件
- Latch free等待事件四(轉)事件
- Latch free等待事件三(轉)事件
- db file scattered read等待事件事件
- db file sequential read等待事件事件