Below query help to find out the CPU usage(Second) for a oracle session session.
select
ss.sql_id "SQL_ID",ss.username,ss.status,ss.machine,b.sql_text,b.PLAN_HASH_VALUE,
VALUE/100 cpu_usage_seconds
from
gv$session ss,
gv$sesstat se,
gv$statname sn,
gv$sql b
where
se.STATISTIC# = sn.STATISTIC#
and
NAME like '%CPU used by this session%'
and
se.SID = ss.SID and ss.sql_id=b.sql_id
and
ss.status='ACTIVE'
and
ss.username is not null
order by VALUE desc;
Thanks,
Jyothish
No comments:
Post a Comment