DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: cpu usage by v$views

  1. #1
    Join Date
    Jan 2001
    Posts
    72

    Question

    Can you use any v$views to see the cpu usage a of a user?

  2. #2
    Join Date
    Aug 2001
    Posts
    111
    Have a look at the doco (Reference section)

    for a session/user use v$sesstat
    for system use v$sysstat

    BTW needs the parameter timed_statistics = true

    Have Fun
    Performance... Push the envelope!

  3. #3
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    And addition you should st OS_TIMED_STATISTICS = n
    where n-seconds interval for collect OS statictict include Processors utilization.

  4. #4
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    I have never heard of OS_TIMED_STATISTICS. Is there really such a parameter?

  5. #5
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    I'm sory - this parameter: TIMED_OS_STATISTICS

    It specifies the interval (in seconds) at which Oracle collects operating system statistics when a request is made from the client to the server or when a request completes.

    On dedicated servers, Oracle collects operating system statistics at user logon and after each subsequent client invocation through the OCI into the Oracle server as a remote procedure call message.

    On shared servers, Oracle collects statistics when client calls to Oracle are processed.

    Information collect in following statistics:

    OS User time used
    OS System time used
    OS Maximum resident set size
    OS Integral shared text size
    OS Integral unshared data size
    OS Integral unshared stack size
    OS Page reclaims
    OS Page faults
    OS Swaps
    OS Block input operations
    OS Block output operations
    OS Socket messages sent
    OS Socket messages received
    OS Signals received
    OS Voluntary context switches
    OS Involuntary context switches

    -------------------------------------------------
    PS:
    Usually I used this parameter when me need:

    OS Page reclaims
    OS Page faults
    OS Swaps
    OS Block input operations
    OS Block output operations

    or
    OS User time used
    OS System time used
    (if we had nondedicated Oracle server or multiply Oracle instances on 1 box)
    -------------------------------------------------





    [Edited by Shestakov on 10-29-2001 at 12:54 PM]

  6. #6
    Join Date
    Jan 2001
    Posts
    72
    Thanks for all the info but that does not answer my question.
    In other words, how do I use v$session,v$sysstat and v$sesstat to
    find out how nuch CPU a particular user is using.

  7. #7
    Join Date
    Aug 2001
    Posts
    111
    You look at the columns in the table and write a query to join v$sesstat to v$session via the column SID (and v$statname to resolve the statistic# to a name)

    Here is an example

    select b.username,b.sid,c.name,a.value
    from v$sesstat a, v$session b, v$statname c
    where b.sid = a.sid
    and a.statistic# = c.statistic#
    and value > &min
    and b.username like '&user'
    order by b.username,c.name

    To find out which users are currently logged in and active you need to look at v$session, or the above SQL could include a condition on status.

    Sorry for being vague... i believe people learn better thru discovery by themselves rather than being spoonfed the complete answer

    Have Fun
    Performance... Push the envelope!

  8. #8
    Join Date
    Jul 2001
    Location
    Singapore(Asia)-WebCentre business company
    Posts
    456
    not true...u help them by throwing them some light and depends on wat light u
    throw :P
    ngwh,
    Singapore.

  9. #9
    Join Date
    Jan 2001
    Posts
    157

    Angry

    I thought we are supposed to share our knowledge on this board. No one person knows everything.You share ideas.

    sorry Mybear, I wish I know the answer to this

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width