標籤

4GL (1) 人才發展 (10) 人物 (3) 太陽能 (4) 心理 (3) 心靈 (10) 文學 (31) 生活常識 (14) 光學 (1) 名句 (10) 即時通訊軟體 (2) 奇狐 (2) 音樂 (2) 產業 (5) 郭語錄 (3) 無聊 (3) 統計 (4) 新聞 (1) 經濟學 (1) 經營管理 (42) 解析度 (1) 遊戲 (5) 電學 (1) 網管 (10) 廣告 (1) 數學 (1) 機率 (1) 雜趣 (1) 證券 (4) 證券期貨 (1) ABAP (15) AD (1) agentflow (4) AJAX (1) Android (1) AnyChart (1) Apache (14) BASIS (4) BDL (1) C# (1) Church (1) CIE (1) CO (38) Converter (1) cron (1) CSS (23) DMS (1) DVD (1) Eclipse (1) English (1) excel (5) Exchange (4) Failover (1) FI (57) File Transfer (1) Firefox (2) FM (2) fourjs (1) gladiatus (1) google (1) Google Maps API (2) grep (1) Grub (1) HR (2) html (23) HTS (8) IE (1) IE 8 (1) IIS (1) IMAP (3) Internet Explorer (1) java (3) JavaScript (22) jQuery (6) JSON (1) K3b (1) LED (3) Linux (112) Linux Mint (4) Load Balance (1) Microsoft (2) MIS (2) MM (51) MSSQL (1) MySQL (27) Network (1) NFS (1) Office (1) Oracle (125) Outlook (3) PDF (6) Perl (59) PHP (33) PL/SQL (1) PL/SQL Developer (1) PM (3) Postfix (2) postfwd (1) PostgreSQL (1) PP (50) python (1) QM (1) Red Hat (4) Reporting Service (28) ruby (11) SAP (234) scp (1) SD (16) sed (1) Selenium-WebDriver (5) shell (5) SQL (4) SQL server (8) SQuirreL SQL Client (1) SSH (2) SWOT (3) Symantec (2) T-SQL (7) Tera Term (2) tip (1) tiptop (22) Tomcat (6) Trouble Shooting (1) Tuning (5) Ubuntu (33) ufw (1) utf-8 (1) VIM (11) Virtual Machine (2) vnc (3) Web Service (2) wget (1) Windows (19) Windows (1) WM (6) youtube (1) yum (2)

2012年12月24日 星期一

Oracle : free buffer wait

http://blog.csdn.net/robinson1988/article/details/4865358
free buffer waits:当一个session试图将一个block读入buffer cache,或者由于读一致需要构造cr的block找不到free buffer而产生的等待。
 SQL> select name,parameter1,parameter2,parameter3,wait_class from v$event_name where name ='free buffer waits';
NAME                 PARAMETER1      PARAMETER2 PARAMETER3 WAIT_CLASS
-------------------- --------------- ---------- ---------- -------------------------------------------------------
free buffer waits    file#           block#     set-id#    Configuration

通常产生这个等待事件有以下原因:
1.buffer cache设置太小。 (2012/12/27這次就是這個原因...我居然沒想到,真丟臉...)
2.I/0写太慢,不能及时将Dirty block写到磁盘。
3.烂SQL导致大量的物理读。
4.Dbwr进程太少
5.DML并发太高,写不赢
p1:文件号  p2:块号 p3:10g以前没有使用,10g以后表示LRU/LURW list的SET_ID#
Oracle最多会等待1秒,然后继续尝试查找空闲缓冲区。
 http://justdba.blogbus.com/logs/65920231.html
    全表扫描时会将大量数据读入buffer,并cache住,此时如果free块不足,就会覆盖clear块(前期cache住的块),由于需要在LRU list上扫描足够可用clear块时,则产生了free buffer wait;如果长时间未找到足够可用的块(即都变为dirty块),此时会触发DBWn将dirty list中的数据块写入磁盘文件,这个过程将是dirty块变为free块,最后cache住全表扫描的数据表;
所以free buffer wait所花费的事件是从扫描LRU list到写入free块的事件(期间经历DBWn的写入磁盘)这么一段时间
解决方法:
1.增大buffer cache,即增加free块,不会频繁的触发DBWn写,提高性能(DBWn写频繁的坏处 1.消耗cpu;2.增大I/O开销)
2.如果buffer cache足够大,还出现了free块不足,可能由于DBWn写的慢,增加DBWn的个数 DB_WRITER_PROCESSES (前提IO正常,以提高I/O为代价)
3.如果buffer cache足够大,DBWn个数也不少,,还出现了free块不足,可能由于DBWn写入磁盘时较慢I/O存在瓶颈(数据被堵住)
4.此时,调优sql,减少disk_reads,降低IO开销
5.此外还有,延迟的块清除原因
 http://oracledba-vinod.blogspot.tw/2009/09/free-buffer-waits.html

Free Buffer Waits

When a user session requires free buffers, the server process scans the LRU list to a get a free buffer space. After scanning the LRU list up to a threshold, if the server process could not get free space, it requests the DBWr to write the dirty buffer from the LRU list to disk. While the DBWr process writes the dirty buffers the session waits on 'Free Buffer Waits'.

Tuning Options

Poor SQL Statements

Query the V$SQL view for statements that have high DISK_READS. Tune the statements to reduce the physical reads. The poorly written SQL Statements are the main cause of this wait event.

DBWr Processes

Increase the DBWr processes (or)
Decrease the Buffer Cache (or)
Decrease the FAST_START_MTTR_TARGET parameter.

Delayed Block Cleanout

The delayed block cleanout will cause the free buffer wait events. To avoid delayed block cleanout perform a full table scan on a table that has been loaded with a lot of rows before it is released to the application.

Small Buffer Cache

Increase the size of Buffer Cache if you feel that the buffer cache is under sized and check for the wait event.

Slow IO

沒有留言:

張貼留言