官术网_书友最值得收藏!

Finding sessions that generate lots of redo

To find sessions generating lots of redo, you can use either of the following methods. Both methods examine the amount of undo generated. When a transaction generates undo, it will automatically generate redo as well.

  • Query v$sess_io: This view contains the column block_changes, which indicates how many blocks have been changed by the session. High values indicate a session generating lots of redo.
  • The query you can use is:
    SQL> SELECT s.sid, s.serial#, s.username, s.program,
    i.block_changes
     2 FROM v$session s, v$sess_io i
     3 WHERE s.sid = i.sid
     4 ORDER BY 5 desc, 1, 2, 3, 4;
    
  • Run the query multiple times and examine the delta between each occurrence of block_changes. Large deltas indicate high redo generation by the session.
  • Query v$transaction: This view contains information about the amount of undo blocks and undo records accessed by the transaction (as found in the used_ublk and used_urec columns).
  • The query you can use is:
    SQL> SELECT s.sid, s.serial#, s.username, s.program, 
    t.used_ublk, t.used_urec
     2 FROM v$session s, v$transaction t
     3 WHERE s.taddr = t.addr
     4 ORDER BY 5 desc, 6 desc, 1, 2, 3, 4;
    
  • Run the query multiple times and examine the delta between each occurrence of used_ublk and used_urec. Large deltas indicate high redo generation by the session.

You use the first query when you need to check for programs generating lots of redo when these programs activate more than one transaction. The latter query can be used to find out which particular transactions are generating redo.

主站蜘蛛池模板: 屯留县| 岳阳县| 龙海市| 彭水| 克拉玛依市| 长兴县| 辽中县| 萨嘎县| 红原县| 西丰县| 天柱县| 榆树市| 隆德县| 瓦房店市| 永善县| 龙泉市| 韩城市| 巴青县| 永康市| 囊谦县| 穆棱市| 娄底市| 黄龙县| 柯坪县| 桃园县| 二连浩特市| 延安市| 噶尔县| 定结县| 赤峰市| 密山市| 绍兴市| 梁平县| 思南县| 赤水市| 鲁山县| 东阿县| 海阳市| 阜平县| 麻阳| 大名县|