ITPub博客

首页 > 数据库 > Oracle > oracle 10g tuning 常用sql

oracle 10g tuning 常用sql

原创 Oracle 作者:weiranjie 时间:2007-06-12 17:17:40 0 删除 编辑

v$active_session_history

V$SYSTEM_WAIT_CLASS

v$session

[@more@]

select
obj.object_name, obj.object_type, ash.event, sum(ash.wait_time + ash.time_waited) wait_time

from
v$active_session_history ash, dba_objects obj

where
ash.sample_time > sysdate -1 and ash.current_obj# = obj.object_id
group by
obj.object_name, obj.object_type, ash.event
order by 4 desc;


select
ash.user_id,
u.username,
sqla.sql_text,
sum(ash.wait_time + ash.time_waited) wait_time
from
v$active_session_history ash, v$sqlarea sqla, dba_users u
where
ash.sample_time > sysdate-1 and ash.sql_id = sqla.sql_id and ash.user_id = u.user_id
group by ash.user_id,sqla.sql_text, u.username
order by 4;

select
ash.event,
sum(ash.wait_time + ash.time_waited) ttl_wait_time
from
v$active_session_history ash
where
ash.sample_time between sysdate - 60/2880 and sysdate
group by
ash.event
order by 2;

=====================================================================================
常用性能视图:

SELECT * FROM V$SYSTEM_WAIT_CLASS WHERE wait_class LIKE '%I/O%'

select * from v$event_name where wait_class like '%I/O%'
select * from v$sessmetric

select * from v$sysstat order by value desc

select * from v$session


select * from v$session_wait_history
where event not like 'SQL%' and event not like '%jobq%' and event not like 'rdbms%'

select * from v$sessmetric

select * from v$sysstat order by value desc

select * from v$session_event
where event not like 'SQL%' and event not like '%jobq%' and event not like 'rdbms%'
order by total_waits
===========================================================================================


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/66233/viewspace-918662/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: OCM 考试
下一篇: 查询 oracle 锁
请登录后发表评论 登录
全部评论

注册时间:2011-02-24

  • 博文量
    70
  • 访问量
    246752