Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: /usr/ucb/ps in hp unix
Thanks all of you for helping me
yes that works beautifully
here is the script i have modifed now for hp which
gives me the top 10 guys who is messing my database
for p in `UNIX95= ps -e -o pcpu -o
pid,args=Command-Line | sort -rnk1 | head -10|awk
'{print $2":"$1}'|grep -v PID`
do
r=`echo $p|cut -d: -f1`
c=`echo $p|cut -d: -f2`
sqlplus -s / << EOF
set heading off;
set line 1000
select 'SPID '||b.spid||' with userid '||a.sid||' is
running '||c.event||' his usr,os,m/c,addr,prg is '||
a.username||' '||a.
machine||' '||a.osuser||' '||a.SQL_ADDRESS||'
'||a.program||' CPU= $c '
"USR_M/C_OSUSR_SQLADDR_PROG_CPU" from v\$session a,v
\$process b, v\$session_wait c where a.PADDR=b.addr
and a.sid=c.sid and b.spid=$r;
exit;
EOF
done
Thanks again
Arun
--- "Khemmanivanh, Somckit"
<somckit.khemmanivanh_at_weyerhaeuser.com> wrote:
>
> Yes, that's an option also:
>
> Setenv UNIX95 XPG4
>
> ps -o comm,cpu,vsz,pid
> COMMAND C VSZ PID
> -csh 0 380 16041
> ps 2 280 19122=20
>
>
> Thanks!=20
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org
> [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of
> John Kanagaraj
> Sent: Tuesday, June 07, 2005 10:58 AM
> To: oracle-l_at_freelists.org
> Subject: RE: /usr/ucb/ps in hp unix
>
> Arun, I seem to remember an environment setting that
> 'switched' the
> behavior
> of certain utilities to Berkeley mode - or it may
> have been a PATH
> settings.
> I had exactly the same issue you had and was able to
> run a 'ps' version
> that
> gave me what you are looking for...
>
> This was about 8 years ago and on HPUX 10, so I may
> be mistaken. Blame
> it on
> loss of memory as we all get older, but this is a
> path worth pursuing.
>
> Regards,
> John Kanagaraj <><
> DB Soft Inc
> Phone: 408-970-7002 (W)
> =20
> Listen to great, commercial-free christian music
> 24x7x365 at
> http://www.klove.com
> =20
> ** The opinions and facts contained in this message
> are entirely mine
> and do
> not reflect those of my employer or customers **
>
>
> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org
> [mailto:oracle-l-bounce_at_freelists.org]
> On Behalf Of Khemmanivanh, Somckit
> Sent: Tuesday, June 07, 2005 10:48 AM
> To: arunrao_oradba_at_yahoo.co.in;
> oracle-l_at_freelists.org
> Subject: RE: /usr/ucb/ps in hp unix
>
> Try this:
>
> glance -adviser_only -syntax -f sk.out -j 1
> -iterations 5 &
>
> more sk.out
> YELLOW ALERT 06/07/05 10:37:42 Network Bottleneck
> probability=3D3D =
> 80.00%
> END
> ALERT 06/07/05 10:37:47 End of Network Bottleneck
> Alert
>
> man glance for details on the -syntax switch...
> =3D20
>
>
> Thanks!=3D20
>
> --
> http://www.freelists.org/webpage/oracle-l
>
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Jun 07 2005 - 15:42:32 CDT
![]() |
![]() |