Try Statspack ...

- Kirti

-----Original Message-----
Sent: Monday, November 25, 2002 5:29 PM
To: Multiple recipients of list ORACLE-L


Even though the name of the statistic is "CPU used by this session,"
the v$sysstat view contains aggregated data of the statistics of all
sessions that have ever logged into your instance since it started.
For consistency, they use the same statistic names as are used by the
session-level statistics from v$sesstat, which is being aggregated in
v$sysstat.  The full list of statistics is in v$statname.  So if you
wanted your own statistics, you would have a query like this:

select value from v$session s, v$sesstat ss, v$statname sn where
s.audsid = userenv('sessionid') and s.sid = ss.sid and ss.statistic# =
sn.statistic# and sn.name = 'CPU used by this session';

To get the total for everyone ever logged in up to now, just query
v$sysstat.

--
Jeremiah Wilton
http://www.speakeasy.net/~jwilton

On Mon, 25 Nov 2002, Gurelei wrote:

> Wouldn't this only give me the statistics for
> MY current session? I'm looking for the data on 
> all the running sessions.
> 
> --- Jeremiah Wilton <[EMAIL PROTECTED]> wrote:
> > How about you collect the following value from each
> > instance on the
> > host, wait a few hours, then collect the numbers
> > again?  You can then
> > subtract the earlier values from the later values,
> > and you'll have a
> > good idea which instances are using more CPU
> > relative to the others.
> > 
> > SQL> select value from v$sysstat where name = 'CPU
> > used by this session';
> > 
> > On Mon, 25 Nov 2002, Gurelei wrote:
> > 
> > > I'm trying to figure out how much of the srever's
> > resources
> > > (CPU-wise) a database and the application running
> > against it is
> > > taking. There are several databases on that server
> > and I'm only
> > > interested in one so vmstat won't really help that
> > much. Besides
> > > just running ps -ef | grep INSTANCE is there any
> > other way for me to
> > > get a feeling of the load that puts on the CPU my
> > database?



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Deshpande, Kirti
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to