RE: Monitoring Unix Question

2002-11-16 Thread ecandrietta
Sthepen :

I am very thankfull for you help ...
But it is not all...
Imagine you working at environment that doesn't know the
database, and need to solve problems.

So, the CPU is a item that you helped me to find out the user
that is using it a lot,

and in general, what more can i do, thinks like that :

1.) the average of load of the server
2.) disk i/o using
3.) the swap in disk of the memory

Best regards

Eriovaldo


> If you have the "top" utility installed on the Unix box, thi
s makes an easy
> to use interface to identify CPU hogs.  For non-
root users to run it, your
> sys admin might have to change default permissions on certai
n "files" such
> as /dev/kmem; or possibly make top SUID root.
>
> If you don't have top, or you can't run it as non-
root, you can try using
> the following ps command to sort things by %
CPU, but I think there might be
> differences among OS's on some of the more exotic ps and sor
t options:
>
> ps -eo pid -o %cpu | sort -rk2 | head -20
>
> After you have identified which PID is the hog, and can see
that it is a
> dedicated server process, you can run something like the fol
lowing to match
> SID & SERIAL# to the correct OS process ID.  If you must bru
tally kill the
> process, kill the session in the database, then kill the pid
 in the OS.
>
> set linesize whatever_you_like
> set pagesize whatever_you_like
>
> col username format a15
> col osuser format a15
>
> select s.username,
>s.osuser,
>s.sid,
>s.serial#,
>s.process "USER PRCS",
>p.spid "SVR PRCS"
>   from v$process p,v$session s
>   where p.addr = s.paddr
>   and s.username <> ' '
> /
>
>
> > -----Original Message-
> > From: ecandrietta [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, November 14, 2002 1:20 PM
> > To: Multiple recipients of list ORACLE-L
> > Subject: Monitoring Unix Question
> >
> >
> >
> > Friends :
> >
> > How can i do for get what is running inside a PID that is
> > using a lot of CPU ?
> >
> > How can I get the query that is running inside the databas
e
> > according PID of unix ?
> >
> > I would like to know commands of the unix and the query th
at
> > i need to run in the database for find out the problem.
> >
> > Regards
> >
> > Eriovaldo
> >
> >
> >
> > ---
> > UOL, o melhor da Internet
> > http://www.uol.com.br/
> >
> > --
> > Please see the official ORACLE-
L FAQ: http://www.orafaq.com
> > --
> > Author: ecandrietta
> >   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 sub
scribing).
> >
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Stephen Lee
>   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 subsc
ribing).
>


---
UOL, o melhor da Internet
http://www.uol.com.br/

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: ecandrietta
  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).



RE: Monitoring Unix Question

2002-11-14 Thread Stephen Lee
If you have the "top" utility installed on the Unix box, this makes an easy
to use interface to identify CPU hogs.  For non-root users to run it, your
sys admin might have to change default permissions on certain "files" such
as /dev/kmem; or possibly make top SUID root.

If you don't have top, or you can't run it as non-root, you can try using
the following ps command to sort things by %CPU, but I think there might be
differences among OS's on some of the more exotic ps and sort options:

ps -eo pid -o %cpu | sort -rk2 | head -20

After you have identified which PID is the hog, and can see that it is a
dedicated server process, you can run something like the following to match
SID & SERIAL# to the correct OS process ID.  If you must brutally kill the
process, kill the session in the database, then kill the pid in the OS.

set linesize whatever_you_like
set pagesize whatever_you_like

col username format a15
col osuser format a15

select s.username,
   s.osuser,
   s.sid,
   s.serial#,
   s.process "USER PRCS",
   p.spid "SVR PRCS"
  from v$process p,v$session s
  where p.addr = s.paddr
  and s.username <> ' '
/


> -Original Message-
> From: ecandrietta [mailto:ecandrietta@;uol.com.br]
> Sent: Thursday, November 14, 2002 1:20 PM
> To: Multiple recipients of list ORACLE-L
> Subject: Monitoring Unix Question 
> 
> 
> 
> Friends :
> 
> How can i do for get what is running inside a PID that is 
> using a lot of CPU ?
> 
> How can I get the query that is running inside the database 
> according PID of unix ?
> 
> I would like to know commands of the unix and the query that 
> i need to run in the database for find out the problem.
> 
> Regards
> 
> Eriovaldo
> 
> 
>  
> ---
> UOL, o melhor da Internet
> http://www.uol.com.br/
> 
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> -- 
> Author: ecandrietta
>   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).
> 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephen Lee
  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).



Re: Monitoring Unix Question

2002-11-14 Thread Connor McDonald
In V$PROCESS there is SPID (or something similar)
which is the OS pid.  Then, you can join to V$SESSION
on ADDR / PADDR 

hth
connor

 --- ecandrietta <[EMAIL PROTECTED]> wrote: > 
> Friends :
> 
> How can i do for get what is running inside a PID
> that is
> using a lot of CPU ?
> 
> How can I get the query that is running inside the
> database
> according PID of unix ?
> 
> I would like to know commands of the unix and the
> query that
> i need to run in the database for find out the
> problem.
> 
> Regards
> 
> Eriovaldo
> 
> 
> 
> ---
> UOL, o melhor da Internet
> http://www.uol.com.br/
> 
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: ecandrietta
>   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). 

=
Connor McDonald
http://www.oracledba.co.uk
http://www.oaktable.net

"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will 
sit in a boat and drink beer all day"

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: =?iso-8859-1?q?Connor=20McDonald?=
  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).



Monitoring Unix Question

2002-11-14 Thread ecandrietta

Friends :

How can i do for get what is running inside a PID that is
using a lot of CPU ?

How can I get the query that is running inside the database
according PID of unix ?

I would like to know commands of the unix and the query that
i need to run in the database for find out the problem.

Regards

Eriovaldo



---
UOL, o melhor da Internet
http://www.uol.com.br/

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: ecandrietta
  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).