首页 > 数据库 > Oracle > oracle 10g tuning 常用sql
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/ ,如需转载,请注明出处,否则将追究法律责任。