[20160608]perf定位問題.txt
[20160608]perf定位問題.txt
-- 很久沒看生產系統的awr報表,有時候偷懶,我直接pert top看看呼叫的函式.
-- 以前我提到過我們生產系統一般靠前的是kcbgtcr排在前面,這個主要是邏輯讀.
# perf top -k /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
PerfTop: 10002 irqs/sec kernel:28.3% exact: 0.0% [1000Hz cycles], (all, 24 CPUs)
-----------------------------------------------------------------------------------------------------------------
samples pcnt function DSO
_______ _____ __________________________ ___________________________________________________________
2219.00 11.6% lnxmul /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
2020.00 10.5% rworofprFastUnpackRow /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
1087.00 5.7% evaopn2 /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
1063.00 5.5% lnxsum /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
1056.00 5.5% evamul /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
810.00 4.2% srsget /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
587.00 3.1% srsqb1tp /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
576.00 3.0% sorgetqbf /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
514.00 2.7% lnxrou /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
505.00 2.6% kaf4reasrp1km /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
440.00 2.3% qesaFastAggNonDistSS /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
427.00 2.2% qersoFetch /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
409.00 2.1% evarou /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
407.00 2.1% srsnext /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
404.00 2.1% lnxsni /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
298.00 1.6% kaf4reasrp0km /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
262.00 1.4% kcbgtcr /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
250.00 1.3% __intel_new_memcpy /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
177.00 0.9% perf_file_section__process /usr/bin/2.6.39-400.126.1.el5uek/perf
--再次看到自己很少見到的函式lnxmul.
SELECT *
FROM ( SELECT sql_id, COUNT (*)
FROM V$ACTIVE_SESSION_HISTORY
WHERE sample_time >= SYSDATE - 5 / 1440
GROUP BY sql_id
ORDER BY 2 DESC)
WHERE ROWNUM <= 2;
SQL_ID COUNT(*)
------------- ----------
8u25kty2p5aus 2093
50
--很明顯問題集中在sql_id='8u25kty2p5aus'.
SYSTEM> select sql_text from v$sql where sql_id='8u25kty2p5aus';
SQL_TEXT
------------------------------------------------------------
SELECT NVL(SUM(FYJE), :"SYS_B_0")
FROM (SELECT (ROUND(B.YPSL * B.CFTS * B.YPDJ,:"SYS_
B_1")) FYJE FROM M
S_CF01 A, MS_CF02 B
WHERE A.CFSB = B.CFSB
AND (A.MZXH IS NULL OR A.MZXH = :"SYS_B_2")
AND A.BRID = :BRID
AND A.JZXH = :JZXH
AND A.KFRQ >= TO_DATE(:
SFRQ,:"SYS_B_3")
AND A.ZFPB = :"SYS_B_4" AND (A.FSLX NOT IN (:"SYS_B_5",:"SYS
_B_6")) OR A.FSLX IS NULL)
--透過toad格式化sql語句如下:
SELECT NVL (SUM (FYJE), :"SYS_B_0")
FROM (SELECT (ROUND (B.YPSL * B.CFTS * B.YPDJ, :"SYS_B_1")) FYJE
FROM MS_CF01 A, MS_CF02 B
WHERE A.CFSB = B.CFSB
AND (A.MZXH IS NULL OR A.MZXH = :"SYS_B_2")
AND A.BRID = :BRID
AND A.JZXH = :JZXH
AND A.KFRQ >= TO_DATE ( :SFRQ, :"SYS_B_3")
AND A.ZFPB = :"SYS_B_4"
AND (A.FSLX NOT IN ( :"SYS_B_5", :"SYS_B_6"))
OR A.FSLX IS NULL)
--昏!寫sql語句也太不嚴謹.看看後面的or ,執行計劃變成了笛卡爾積.變成了不可能完成的語句.
--應該寫成如下:
SELECT NVL (SUM (FYJE), :"SYS_B_0")
FROM (SELECT (ROUND (B.YPSL * B.CFTS * B.YPDJ, :"SYS_B_1")) FYJE
FROM MS_CF01 A, MS_CF02 B
WHERE A.CFSB = B.CFSB
AND (A.MZXH IS NULL OR A.MZXH = :"SYS_B_2")
AND A.BRID = :BRID
AND A.JZXH = :JZXH
AND A.KFRQ >= TO_DATE ( :SFRQ, :"SYS_B_3")
AND A.ZFPB = :"SYS_B_4"
AND ( (A.FSLX NOT IN ( :"SYS_B_5", :"SYS_B_6"))
OR A.FSLX IS NULL))
--寫錯其實很正常,問題是如何測試的,順便執行一次就能發現問題,失望!!!
--我題目有一些誇大了,實際上還是透過其他定位問題.不過透過perf瞭解整體狀態還是不錯的.
-- 很久沒看生產系統的awr報表,有時候偷懶,我直接pert top看看呼叫的函式.
-- 以前我提到過我們生產系統一般靠前的是kcbgtcr排在前面,這個主要是邏輯讀.
# perf top -k /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
PerfTop: 10002 irqs/sec kernel:28.3% exact: 0.0% [1000Hz cycles], (all, 24 CPUs)
-----------------------------------------------------------------------------------------------------------------
samples pcnt function DSO
_______ _____ __________________________ ___________________________________________________________
2219.00 11.6% lnxmul /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
2020.00 10.5% rworofprFastUnpackRow /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
1087.00 5.7% evaopn2 /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
1063.00 5.5% lnxsum /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
1056.00 5.5% evamul /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
810.00 4.2% srsget /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
587.00 3.1% srsqb1tp /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
576.00 3.0% sorgetqbf /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
514.00 2.7% lnxrou /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
505.00 2.6% kaf4reasrp1km /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
440.00 2.3% qesaFastAggNonDistSS /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
427.00 2.2% qersoFetch /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
409.00 2.1% evarou /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
407.00 2.1% srsnext /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
404.00 2.1% lnxsni /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
298.00 1.6% kaf4reasrp0km /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
262.00 1.4% kcbgtcr /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
250.00 1.3% __intel_new_memcpy /u01/app/oracle/product/11.2.0.4/dbhome_1/bin/oracle
177.00 0.9% perf_file_section__process /usr/bin/2.6.39-400.126.1.el5uek/perf
--再次看到自己很少見到的函式lnxmul.
SELECT *
FROM ( SELECT sql_id, COUNT (*)
FROM V$ACTIVE_SESSION_HISTORY
WHERE sample_time >= SYSDATE - 5 / 1440
GROUP BY sql_id
ORDER BY 2 DESC)
WHERE ROWNUM <= 2;
SQL_ID COUNT(*)
------------- ----------
8u25kty2p5aus 2093
50
--很明顯問題集中在sql_id='8u25kty2p5aus'.
SYSTEM> select sql_text from v$sql where sql_id='8u25kty2p5aus';
SQL_TEXT
------------------------------------------------------------
SELECT NVL(SUM(FYJE), :"SYS_B_0")
FROM (SELECT (ROUND(B.YPSL * B.CFTS * B.YPDJ,:"SYS_
B_1")) FYJE FROM M
S_CF01 A, MS_CF02 B
WHERE A.CFSB = B.CFSB
AND (A.MZXH IS NULL OR A.MZXH = :"SYS_B_2")
AND A.BRID = :BRID
AND A.JZXH = :JZXH
AND A.KFRQ >= TO_DATE(:
SFRQ,:"SYS_B_3")
AND A.ZFPB = :"SYS_B_4" AND (A.FSLX NOT IN (:"SYS_B_5",:"SYS
_B_6")) OR A.FSLX IS NULL)
--透過toad格式化sql語句如下:
SELECT NVL (SUM (FYJE), :"SYS_B_0")
FROM (SELECT (ROUND (B.YPSL * B.CFTS * B.YPDJ, :"SYS_B_1")) FYJE
FROM MS_CF01 A, MS_CF02 B
WHERE A.CFSB = B.CFSB
AND (A.MZXH IS NULL OR A.MZXH = :"SYS_B_2")
AND A.BRID = :BRID
AND A.JZXH = :JZXH
AND A.KFRQ >= TO_DATE ( :SFRQ, :"SYS_B_3")
AND A.ZFPB = :"SYS_B_4"
AND (A.FSLX NOT IN ( :"SYS_B_5", :"SYS_B_6"))
OR A.FSLX IS NULL)
--昏!寫sql語句也太不嚴謹.看看後面的or ,執行計劃變成了笛卡爾積.變成了不可能完成的語句.
--應該寫成如下:
SELECT NVL (SUM (FYJE), :"SYS_B_0")
FROM (SELECT (ROUND (B.YPSL * B.CFTS * B.YPDJ, :"SYS_B_1")) FYJE
FROM MS_CF01 A, MS_CF02 B
WHERE A.CFSB = B.CFSB
AND (A.MZXH IS NULL OR A.MZXH = :"SYS_B_2")
AND A.BRID = :BRID
AND A.JZXH = :JZXH
AND A.KFRQ >= TO_DATE ( :SFRQ, :"SYS_B_3")
AND A.ZFPB = :"SYS_B_4"
AND ( (A.FSLX NOT IN ( :"SYS_B_5", :"SYS_B_6"))
OR A.FSLX IS NULL))
--寫錯其實很正常,問題是如何測試的,順便執行一次就能發現問題,失望!!!
--我題目有一些誇大了,實際上還是透過其他定位問題.不過透過perf瞭解整體狀態還是不錯的.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2117697/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20111227]strace 定位問題一例.txt
- 定位和居中問題
- JVM問題定位工具JVM
- ios XCUIElement 元素定位問題iOSUI
- 滑鼠定位問題總結
- OOM分析之問題定位(二)OOM
- 解決高度塌陷、定位問題
- 磁碟問題定位與解決
- 使用git bisect快速定位問題Git
- postgresql copy UNICODE txt 問題。SQLUnicode
- 如何定位瀏覽器卡死問題瀏覽器
- Spark —— Spark OOM Error問題排查定位SparkOOMError
- 網路問題定位工具記錄
- ios8系統定位問題iOS
- eMarketer:定位廣告的距離問題
- WEB應用訪問緩慢的問題定位Web
- 軟體效能問題正確定位思路
- 如何優雅地定位外網問題?
- 小知識:使用errorstack定位特定問題Error
- Hbuilder打包IOS關於定位描述問題UIiOS
- css中的定位和框模型問題CSS模型
- DW中AP DIV定位的問題【Z】
- MySQL 中如何定位 DDL 被阻塞的問題MySql
- 記一次jstack命令定位問題JS
- MySQL問題定位-效能優化之我見MySql優化
- 利用jstack定位典型效能問題例項JS
- 掌握運維必備技能--問題故障定位運維
- UI 自動化元素定位規範問題UI
- 如何利用執行緒堆疊定位問題執行緒
- 記憶體和棧溢位問題定位記憶體
- CSS定位問題(1):盒模型、浮動、BFCCSS模型
- 網站速度問題排查與定位經驗網站
- RAC 鎖管理與鎖問題的定位(二)
- RAC 鎖管理與鎖問題的定位(一)
- [ 天羽]pv問題定位,pvid重複
- 達夢儲存過程效能問題定位儲存過程
- [轉帖]使用perf解決JDK8U小版本升級後效能下降的問題JDK
- perf 安裝到分析