ORACLE 資料庫11.2.0.4 單例項伺服器IO等待高問題分析
ORACLE 資料庫11.2.0.4 單例項伺服器IO等待高問題分析。分析過程中發現一條SQL消耗IO高的SQL,進一步分析發現有全表掃描,另外發現主機IO-WAIT高的時間段內有備份作業在執行,初步確定是備份作業和SQL全表掃描導致主機IO-wait高,觸發告警。
1、問題描述
20180929,客戶反饋伺服器磁碟IOWAIT 較高,一般在10以上,高的時候,可達30%以上。
2、提取分析日誌,資料庫告警日誌、問題時段的AWR、及問題SQL的sqlhc、系統IOTOP監控記錄
3、問題分析
a、觀察資料庫告警日誌,沒有發現異常的資料庫ORA報錯
b、觀察系統IOTOP監控記錄發現問題時段有資料庫備份任務在執行:
c、觀察問題時段資料庫的AWR發現一條又效能問題的SQL語句:
SQL語句文字如下:
select a.inter_code, a.hq_date, a.repair_unit_nav as unit_nav
from dm_fund_hq a, dm_stock_info b where a.inter_code = b.inter_code and b.fund_style in (100301, 100101, 100201) and a.hq_date > to_char(add_months(sysdate, -12), 'yyyyMMdd') and a.inter_code = :1 order by a.hq_date |
SQL執行計劃如下:
根據oracle的SQL自動調優,獲得如下建議:
FINDINGS SECTION (2 findings)
-------------------------------------------------------------------------------
1- SQL Profile Finding (see explain plans section below)
--------------------------------------------------------
A potentially better execution plan was found for this statement.
Recommendation (estimated benefit: 86.11%)
------------------------------------------
- Consider accepting the recommended SQL profile to use parallel execution
for this statement.
execute dbms_sqltune.accept_sql_profile(task_name => 'TASK_16308',
task_owner => 'SYS', replace => TRUE, profile_type =>
DBMS_SQLTUNE.PX_PROFILE);
Executing this query parallel with DOP 8 will improve its response time
86.11% over the original plan. However, there is some cost in enabling
parallel execution. It will increase the statement's resource consumption by
an estimated 11.11% which may result in a reduction of system throughput.
Also, because these resources are consumed over a much smaller duration, the
response time of concurrent statements might be negatively impacted if
sufficient hardware capacity is not available.
The following data shows some sampled statistics for this SQL from the past
week and projected weekly values when parallel execution is enabled.
Past week sampled statistics for this SQL
-----------------------------------------
Number of executions 0
Percent of total activity 0
Percent of samples with #Active Sessions > 2*CPU 0
Weekly DB time (in sec) 0
Projected statistics with Parallel Execution
--------------------------------------------
Weekly DB time (in sec) 0
2- Index Finding (see explain plans section below)
--------------------------------------------------
The execution plan of this statement can be improved by creating one or more
indices.
Recommendation (estimated benefit: 99.98%)
------------------------------------------
- Consider running the Access Advisor to improve the physical schema design
or creating the recommended index.
create index ETSPRD.IDX$$_3FB40001 on ETSPRD.DM_STOCK_INFO("INTER_CODE");
- Consider running the Access Advisor to improve the physical schema design
or creating the recommended index.
create index ETSPRD.IDX$$_3FB40002 on
ETSPRD.DM_FUND_HQ("INTER_CODE","HQ_DATE","REPAIR_UNIT_NAV");
Rationale
---------
Creating the recommended indices significantly improves the execution plan
of this statement. However, it might be preferable to run "Access Advisor"
using a representative SQL workload as opposed to a single statement. This
will allow to get comprehensive index recommendations which takes into
account index maintenance overhead and additional space consumption.
4、分析總結
a、問題時段有備份任務執行,消耗系統伺服器CPU、IO資源;
b、觀察問題時段AWR發現一條可最佳化的SQL語句,相關最佳化措施見問題分析。 ORACLE 資料庫11.2.0.4 單例項伺服器IO等待高問題分析。分析過程中發現一條SQL消耗IO高的SQL,進一步分析發現有全表掃描,另外發現主機IO-WAIT高的時間段內有備份作業在執行,初步確定是備份作業和SQL全表掃描導致主機IO-wait高,觸發告警。
1、問題描述
20180929,客戶反饋伺服器磁碟IOWAIT 較高,一般在10以上,高的時候,可達30%以上。
2、提取分析日誌,資料庫告警日誌、問題時段的AWR、及問題SQL的sqlhc、系統IOTOP監控記錄
3、問題分析
a、觀察資料庫告警日誌,沒有發現異常的資料庫ORA報錯
b、觀察系統IOTOP監控記錄發現問題時段有資料庫備份任務在執行:
c、觀察問題時段資料庫的AWR發現一條又效能問題的SQL語句:
SQL語句文字如下:
select a.inter_code, a.hq_date, a.repair_unit_nav as unit_nav
from dm_fund_hq a, dm_stock_info b where a.inter_code = b.inter_code and b.fund_style in (100301, 100101, 100201) and a.hq_date > to_char(add_months(sysdate, -12), 'yyyyMMdd') and a.inter_code = :1 order by a.hq_date |
SQL執行計劃如下:
根據oracle的SQL自動調優,獲得如下建議:
FINDINGS SECTION (2 findings)
-------------------------------------------------------------------------------
1- SQL Profile Finding (see explain plans section below)
--------------------------------------------------------
A potentially better execution plan was found for this statement.
Recommendation (estimated benefit: 86.11%)
------------------------------------------
- Consider accepting the recommended SQL profile to use parallel execution
for this statement.
execute dbms_sqltune.accept_sql_profile(task_name => 'TASK_16308',
task_owner => 'SYS', replace => TRUE, profile_type =>
DBMS_SQLTUNE.PX_PROFILE);
Executing this query parallel with DOP 8 will improve its response time
86.11% over the original plan. However, there is some cost in enabling
parallel execution. It will increase the statement's resource consumption by
an estimated 11.11% which may result in a reduction of system throughput.
Also, because these resources are consumed over a much smaller duration, the
response time of concurrent statements might be negatively impacted if
sufficient hardware capacity is not available.
The following data shows some sampled statistics for this SQL from the past
week and projected weekly values when parallel execution is enabled.
Past week sampled statistics for this SQL
-----------------------------------------
Number of executions 0
Percent of total activity 0
Percent of samples with #Active Sessions > 2*CPU 0
Weekly DB time (in sec) 0
Projected statistics with Parallel Execution
--------------------------------------------
Weekly DB time (in sec) 0
2- Index Finding (see explain plans section below)
--------------------------------------------------
The execution plan of this statement can be improved by creating one or more
indices.
Recommendation (estimated benefit: 99.98%)
------------------------------------------
- Consider running the Access Advisor to improve the physical schema design
or creating the recommended index.
create index ETSPRD.IDX$$_3FB40001 on ETSPRD.DM_STOCK_INFO("INTER_CODE");
- Consider running the Access Advisor to improve the physical schema design
or creating the recommended index.
create index ETSPRD.IDX$$_3FB40002 on
ETSPRD.DM_FUND_HQ("INTER_CODE","HQ_DATE","REPAIR_UNIT_NAV");
Rationale
---------
Creating the recommended indices significantly improves the execution plan
of this statement. However, it might be preferable to run "Access Advisor"
using a representative SQL workload as opposed to a single statement. This
will allow to get comprehensive index recommendations which takes into
account index maintenance overhead and additional space consumption.
4、分析總結
a、問題時段有備份任務執行,消耗系統伺服器CPU、IO資源;
b、觀察問題時段AWR發現一條可最佳化的SQL語句,相關最佳化措施見問題分析。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29357786/viewspace-2215382/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 資料庫高io問題調查資料庫
- oracle資料庫與oracle例項Oracle資料庫
- Oracle 11G資料庫單例項安裝Oracle資料庫單例
- oracle 11g 單例項資料庫的安裝Oracle單例資料庫
- oracle 12c 資料庫例項監聽無法註冊問題一例Oracle資料庫
- oracle資料庫建立資料庫例項-九五小龐Oracle資料庫
- 滴滴雲伺服器上安裝Oracle12cR2單例項資料庫伺服器Oracle單例資料庫
- oracle資料庫11.2.0.3升級到11.2.0.4Oracle資料庫
- 【ASK_ORACLE】Relink ASM單例項資料庫詳細步驟OracleASM單例資料庫
- 記錄一次Oracle 11.2.0.4 RAC異地恢復到單例項Oracle單例
- Oracle 資料庫巡檢指令碼 單例項 RAC 輸出HTML格式Oracle資料庫指令碼單例HTML
- oracle rac 單個例項不能生成awr報告的問題Oracle
- Oracle資料庫 11.2.0.4 EMON程式持續消耗CPUOracle資料庫
- 19C 單例項資料庫安裝單例資料庫
- openGauss資料庫分析問題資料庫
- MySQL和Oracle的後設資料抽取例項分析KRGXMySqlOracle
- oracle11g單例項透過命令列dbca靜默建立資料庫Oracle單例命令列資料庫
- oracle 11.2.0.4 rac叢集等待事件enq: TM - contentionOracle事件ENQ
- ORACLE---Aix7.1 安裝Oracle11.2.0.4版本資料庫OracleAI資料庫
- 【資料庫資料恢復】ASM例項不能掛載的Oracle資料庫資料恢復案例資料庫資料恢復ASMOracle
- oracle資料庫跨平臺(AIX)從RAC恢復至(linux)下的單例項Oracle資料庫AILinux單例
- 資料庫索引分裂 問題分析資料庫索引
- MySQL資料庫故障分析-鎖等待(一)MySql資料庫
- 【TUNE_ORACLE】等待事件之IO等待“read by other session”Oracle事件Session
- 【TUNE_ORACLE】等待事件之IO等待“direct path read”Oracle事件
- 【TUNE_ORACLE】等待事件之IO等待“direct path write”Oracle事件
- 【odoo】【知識雜談】單一例項多庫模式下定時任務的問題分析Odoo模式
- mysql資料庫磁碟io高的排查MySql資料庫
- [20191202]關於oracle例項是否使用hugepages問題.txtOracle
- mongodb關閉資料庫例項MongoDB資料庫
- 11.2.0.4單例項ASM安裝報錯ohasd failed to ... line 73.單例ASMAI
- 【TUNE_ORACLE】等待事件之IO等待“db file scattered read”Oracle事件
- 【TUNE_ORACLE】等待事件之IO等待“direct path write temp”Oracle事件
- 【TUNE_ORACLE】等待事件之IO等待“db file sequential read”Oracle事件
- 【TUNE_ORACLE】等待事件之IO等待“db file parallel write”Oracle事件Parallel
- 【資料庫資料恢復】Oracle ASM例項無法掛載的資料恢復案例資料庫資料恢復OracleASM
- 將RAC備份集恢復為單例項資料庫單例資料庫
- 達夢資料庫單例項轉實時同步叢集資料庫單例