日期:2014-05-16 浏览次数:20439 次
那么是数据库主机,问题定位在数据库上。
SELECT * FROM (
SELECT a.module
, a.sql_id
, a.session_state
, count(*)
, lpad(round(ratio_to_report(count(*)) over () * 100)||'%',10,' ') percent
FROM
dba_hist_active_sess_history a
WHERE
a.sample_time BETWEEN to_date('2012:08:01:15:00:00','YY-MM-DD:HH24:MI:SS')
AND to_date( '2012:08:01:15:40:00','YY-MM-DD:HH24:MI:SS')
GROUP BY
a.module
, a.sql_id
, a.session_state
ORDER BY
percent DESC
)
WHERE ROWNUM <= 30;
我很喜欢用如上的方式,按照某些条件来分组,来查看session对系统的影响程度,进而来分析:
MODULE SQL_ID SESSION_STATE COUNT(*) PERCENT
------------------------------------------------ ------------- ------------- ---------- -------------
PL/SQL Developer 1qbw09atztvzn ON CPU 7312 59%
PL/SQL Developer 8tg77v2fjyvus ON CPU 472 4%
JTC db-app-g17-c1b1-srv1 7387@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 220 2%
JTC db-app-g17-c1b1-srv2 7384@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 232 2%
JTC db-app-g17-c1b1-srv3 26446@pc-dbjadb17. 0a3db3m5h72rb ON CPU 197 2%
JTC db-app-g17-c1b1-srv4 26442@pc-dbjadb17. 0a3db3m5h72rb ON CPU 199 2%
PL/SQL Developer 9r57k363xqdvg ON CPU 236 2%
JTC db-app-g17-c1b2-srv1 7369@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 114 1%
JTC db-app-g17-c2b3-srv4 26404@pc-dbjadb17. 0a3db3m5h72rb ON CPU 67 1%
JTC db-app-g17-c2b4-srv2 7358@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 70 1%
JTC db-app-g17-c3b5-srv1 7372@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 75 1%
JTC db-app-g17-c3b5-srv3 26372@pc-dbjadb17. 0a3db3m5h72rb ON CPU 80 1%
JTC db-app-g17-c4b7-srv4 26417@pc-dbjadb17. 0a3db3m5h72rb ON CPU 63 1%
JTC db-app-g17-c4b7-srv3 26366@pc-dbjadb17. 0a3db3m5h72rb ON CPU 67 1%
JTC db-app-g17-c4b7-srv2 7363@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 65 1%
JTC db-app-g17-c4b7-srv1 7393@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 66 1%
JTC db-app-g17-c3b6-srv1 7352@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 62 1%
JTC db-app-g17-c3b5-srv4 26545@pc-dbjadb17. 0a3db3m5h72rb ON CPU 82 1%
JTC db-app-g17-c3b5-srv2 7362@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 81 1%
JTC db-app-g17-c2b4-srv3 26543@pc-dbjadb17. 0a3db3m5h72rb ON CPU 72 1%
JTC db-app-g17-c2b4-srv1 7381@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 62 1%
JTC db-app-g17-c2b3-srv3 26460@pc-dbjadb17. 0a3db3m5h72rb ON CPU 66 1%
JTC db-app-g17-c1b2-srv2 7373@pc-dbdadb17.s 0a3db3m5h72rb ON CPU 113 1%
JTC db-app-g17-c1b2-srv4 26415@pc-dbjadb17. 0a3db3m5h72rb ON CPU 113 1%
JTC db-app-g17-c1b2-srv3 26523@pc-dbjadb17. 0a3db3m5h72rb ON CPU 119 1%
? @dbdacsb3 (TNS V1-V3) farj17af7zpq5 ON CPU 1 0%
? @dbdasso1 (TNS V1-V3) fa292z74w82s5 WAITING 1 0%
? @dbdasso1 (TNS V1-V3) ON CPU 2 0%
? @dbdasso1 (TNS V1-V3)