Re: Active Session History count(*) vs. sum(time_waited)

From: Marcin Przepiorowski <pioro1_at_gmail.com>
Date: Thu, 16 Jan 2014 19:52:19 +0000
Message-ID: <CAGdek=ws_DviFvUHJ77GgKw2-7=ro8TnC+Yf8ak1ALcP7N8OpQ_at_mail.gmail.com>



Hi,

ASH is a sampled mechanism of the sessions activity (v$session view). If you do a sum (time_waited) you just adding up waited time if session is waiting for more than one sample.
Check this great presentation about DB Time and ASH by Graham Wood and John Beresniewicz - guys who designed it - "*DB*-*Time*-based *Oracle Performance Tuning*: *Theory and Practice" *ex. here www.nocoug.org/download/2008-02/*DBTime*.ppt

regards,
Marcin

On Thu, Jan 16, 2014 at 5:21 PM, Dba DBA <oracledbaquestions_at_gmail.com>wrote:

> DB Version: 11.2.0.2
> Grid Control: 11g (not sure on exact version)
>
> When I look in Grid Control I See 1 SQL as a top SQL State and it says the
> primary wait is: SQL*Net more data from client
>
> I ran the following sql against v$active_Session_history. My understanding
> is
>
> select event,count(*),sum(time_waited)
> from v$active_Session_history
> where sql_id = <problem sql>
> and sample_time > sysdate - 1/24
> and session_state = 'WAITING' -- there is no ON CPU output anyway
> group by event
>
> EVENT COUNT(*)
> SUM(TIME_WAITED)
> SQL*Net(abbreviated) 93000 0
> db file sequential read 11
> 93533
>
> It looks like the Grid Control performance screen rolls up off the
> count(*) right? My understanding is that each count represents 1 second. So
> 93,000 represents 1 second. I must be misunderstanding this.
>
> I clearly don't understand v$active_Session_history. How can I have a
> count(*) so high but no time waited and then vice versa? If I'm reading the
> doc correctly, TIME_WAITED only goes up if SESSION_STATE='WAITING'. I am
> only seeing waiting. I am not seeing any ON CPU.
>
> I clearly don't understand how these fields work. Can someone correct me?
>

-- 
Marcin Przepiorowski
http://oracleprof.blogspot.com

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jan 16 2014 - 20:52:19 CET

Original text of this message