Oracle 10g数据库中如何分析响应时间
2007-05-13 12:27:36 来源:WEB开发网核心提示: 上面的查询包含了更多的详细的响应时间数据,DBA们还需要收集在系统级别上的用户通讯的平均响应时间,Oracle 10g数据库中如何分析响应时间(4),上面的查询给出了需要的结果,如果用户抱怨响应时间太慢,(select round((value / 1000000),3) plsql_ti
上面的查询包含了更多的详细的响应时间数据。DBA们还需要收集在系统级别上的用户通讯的平均响应时间,上面的查询给出了需要的结果。如果用户抱怨响应时间太慢,那么DBA就应该查看Response Time Per Txn和SQL Service Response Time数据是否存在数据库问题。
如果响应时间不在是那么渴求,那么DBA就会想了解究竟是什么类型的用户活动让数据库的响应变得如此的慢,在Oracle10g数据库之前,这些信息 是比较难获取的,但是现在就变得非常容易,执行如下查询:
select case db_stat_name
when 'parse time elapsed' then
'soft parse time'
else db_stat_name
end db_stat_name,
case db_stat_name
when 'sql execute elapsed time' then
time_secs - plsql_time
when 'parse time elapsed' then
time_secs - hard_parse_time
else time_secs
end time_secs,
case db_stat_name
when 'sql execute elapsed time' then
round(100 * (time_secs - plsql_time) / db_time,2)
when 'parse time elapsed' then
round(100 * (time_secs - hard_parse_time) / db_time,2)
else round(100 * time_secs / db_time,2)
end pct_time
from
(select stat_name db_stat_name,
round((value / 1000000),3) time_secs
from sys.v_$sys_time_model
where stat_name not in('DB time','background elapsed time',
'background cpu time','DB CPU')),
(select round((value / 1000000),3) db_time
from sys.v_$sys_time_model
where stat_name = 'DB time'),
(select round((value / 1000000),3) plsql_time
from sys.v_$sys_time_model
where stat_name = 'PL/SQL execution elapsed time'),
(select round((value / 1000000),3) hard_parse_time
from sys.v_$sys_time_model
where stat_name = 'hard parse elapsed time')
order by 2 desc;
DB_STAT_NAME TIME_SECS PCT_TIME
sql execute elapsed time 65.644 89.7
hard parse elapsed time 26.661 36.43
PL/SQL execution elapsed time 12.766 17.44
PL/SQL compilation elapsed time 6.353 8.68
soft parse time 2.15 2.94
connection management call elapsed time 1.084 1.48
hard parse (sharing criteria) elapsed time 0.448 0.61
repeated bind elapsed time 0.026 0.04
failed parse elapsed time 0.009 0.01
hard parse (bind mismatch) elapsed time 0.002 0
RMAN cpu time (backup/restore) 0 0
inbound PL/SQL rpc elapsed time 0 0
sequence load elapsed time 0 0
Java execution elapsed time 0 0
failed parse (out of shared memory) elapsed time 0 0
更多精彩
赞助商链接