【原創】cache buffer chains的一次解決過程
環境:AIX 5.2
資料庫版本:10.2.0.2
一個生產資料庫的cache buffer chains等待比較嚴重,考慮對其進行優化,下面是對這個問題的一次解決過程(主要是加大熱表的pctfree):
$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.2.0 - Production on Tue May 27 20:21:29 2008
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
原來已經通過x$bh找到了幾張最熱的表,並且將這幾張表放在了keep池中
SQL> select table_name from dba_tables where buffer_pool='KEEP';
TABLE_NAME
------------------------------
TD_MESSAGE
TS_PHRASE
TD_PLAN_LEG
檢視一下keep池的大小是不是合適
SQL> show parameter keep
NAME TYPE VALUE
------------------------------------ -------------------------------- ------------------------------
buffer_pool_keep string
control_file_record_keep_time integer 7
db_keep_cache_size big integer 64M
SQL> select sum(blocks) from dba_tables where buffer_pool='KEEP';
SUM(BLOCKS)
-----------
11821
SQL>select 11821*8/1024 from dual;
11821*8/1024
------------
92.3515625
可以看出keep池目前64m的配置已經不能滿足要求了,將它擴充套件為100m
SQL> alter system set db_keep_cache_size=100m;
System altered.
檢視熱表的pctfree,發現都是預設的10
SQL> select table_name,pct_free from dba_tables where buffer_pool='KEEP';
TABLE_NAME PCT_FREE
------------------------------ ----------
TD_MESSAGE 10
TS_PHRASE 10
TD_PLAN_LEG 10
將最熱的td_plan_leg表的pctfree改為40,儘量將資料分散在多個塊中
SQL> alter table fgos.td_plan_leg pctfree 40;
Table altered.
為了避免行遷移,將表td_message的pctfree改為20
SQL> alter table fgos.td_message pctfree 20;
Table altered.
SQL> select table_name,pct_free,avg_row_len from dba_tables where buffer_pool='KEEP';
TABLE_NAME PCT_FREE AVG_ROW_LEN
------------------------------ ---------- -----------
TD_MESSAGE 20 223
TS_PHRASE 10 108
TD_PLAN_LEG 40 480
修改完成後move 表td_plan_leg和td_message,使修改在已有的塊上生效
SQL>alter table fgos.TD_PLAN_LEG move;
Table altered.
SQL>alter table fgos.TD_MESSAGE move;
Table altered.
將這兩張表上的index rebuild
SQL> select 'alter index fgos.'||index_name||' rebuild online;' from dba_indexes where table_name in ('TD_PLAN_LEG','TD_MESSAGE');
'ALTERINDEXFGOS.'||INDEX_NAM
----------------------------------------------------------------------------------------------
alter index fgos.XTD_MESSAGE_OPTM rebuild online;
alter index fgos.TM_TYPEAD_INDEX rebuild online;
alter index fgos.TM_SUB_TYPE_INDEX rebuild online;
alter index fgos.TM_SND_TM_INDEX rebuild online;
alter index fgos.TM_MSG_TYPE_INDEX rebuild online;
alter index fgos.TM_FLTNO_INDEX rebuild online;
alter index fgos.SYS_C0027692 rebuild online;
alter index fgos.SYS_IL0000081505C00010$$ rebuild online;
alter index fgos.SYS_C0012101 rebuild online;
alter index fgos.XTD_PLAN_LEG_THRARR rebuild online;
alter index fgos.XTD_PLAN_LEG_THRDEP rebuild online;
alter index fgos.XTD_PLAN_LEG_OPTM rebuild online;
alter index fgos.XTD_PLAN_LEG_FLTNO rebuild online;
alter index fgos.XTD_PLAN_LEG_ALTW rebuild online;
alter index fgos.XTD_PLAN_LEG_PUBFLAG rebuild online;
alter index fgos.XTD_PLAN_FLT_ID rebuild online;
16 rows selected.
重新收集兩張表的統計值
SQL> exec dbms_stats.gather_table_stats('fgos','td_plan_leg');
PL/SQL procedure successfully completed.
SQL> exec dbms_stats.gather_table_stats('fgos','td_message');
PL/SQL procedure successfully completed.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/498744/viewspace-327293/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CACHE BUFFER CHAINSAI
- Oracle Cache Buffer ChainsOracleAI
- Latch: cache buffer chains (%)AI
- 一次library cache pin故障的解決過程
- buffer cache實驗6-latch:cache buffers lru chainsAI
- cbc latch或cache buffer chains latch系列一AI
- latch:cache buffers chains解決步驟AI
- 【原創】記錄一次Tomcat總是載入舊專案的解決過程Tomcat
- cache buffers chains and cache buffers lru chainsAI
- 客戶資料庫出現大量cache buffer chains latch資料庫AI
- 解決一例latch:cache buffers chains小記AI
- 一次latch cache buffers chains問題的處理AI
- 一次線上問題的排查解決過程
- 一次sqlldr匯入慢的解決過程SQL
- buffer busy waits, latch cache buffers chains, read by other session區別AISession
- 原創:oracle 儲存過程Oracle儲存過程
- latch: cache buffers chainsAI
- 記一次 Composer 問題的解決過程!!
- 一次RAC節點當機的解決過程
- 一次Row Cache Lock問題處理過程
- 熱點塊競爭和解決--cache buffers chainsAI
- cache buffers chains vs cache buffers lru chainAI
- 原創:oracle 授權的詳細過程Oracle
- windows 上的手工建庫過程 (原創)Windows
- latch:cache buffers chains案例AI
- page cache與buffer cache的關係
- Buffer Cache 原理
- cache buffer chainAI
- 記錄一次排查解決伺服器卡死的過程伺服器
- [原創]儲存過程效能測試儲存過程
- 用於排查cache buffers chainsAI
- Cache Buffers chains,存在共享模式?AI模式
- latch:cache buffers chains的優化思路AI優化
- 記一次library cache pin事件解決事件
- IO之核心buffer----"buffer cache"
- 一次難忘的協助解決Oracle RAC恢復過程Oracle
- 記一次bug解決過程(數字轉化成中文)
- 【原創】ORA-00054問題的解決(plan_table在autotrace過程中會被鎖定)